No dog shall be classified as a dangerous dog or vicious dog for actions that occur while the dog is being used by a law enforcement or military officer to carry out the law enforcement or military officer's official duties. No dog shall be classified as a dangerous dog or a 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 Annotated.