It is a defense in an action alleging a prosecuting attorney committed official misconduct described by Section 87.011(3)(C) that the prosecuting attorney took action immediately on discovering an attorney employed by or otherwise under the direction or control of the prosecuting attorney was acting as described by Section 87.011(3)(C).
Tex. Loc. Gov't. Code § 87.0131