Whenever any peace officer is a witness before any court or magistrate in any criminal action or proceeding in connection with a matter regarding an event or transaction which he has perceived or investigated in the course of his duties, where his testimony would become a matter of public record, and where he is required to state the place of his residence, he need not state the place of his residence, but in lieu thereof, he may state his business address.
Ca. Pen. Code § 1328.5