No dog shall be classified as a dangerous dog or vicious dog for actions that occur while the dog is being used by a police officer or military officer to carry out the police or military officer's official duties. No dog shall be considered a dangerous dog, or vicious dog if the person injured by such dog was a person who, at the time, was committing a trespass, was abusing the dog, or was committing or attempting to commit an offense under Chapter 5 of Title 16 of the Official Code of Georgia.