The terms "dangerous animal" and "potentially dangerous animal," as defined in section 6-20, shall not include the following: (1) An animal that inflicts an injury upon a person when the animal is being used by a law enforcement officer to carry out the law enforcement officer's official duties; and (2) An animal who inflicts an injury within the meaning of this article if the injury was sustained by a person who, at the time, was committing a willful trespass or other tort, or was tormenting, abusing, or assaulting the animal or had in the past been observed or reported to have tormented, abused, or assaulted the animal or was committing or attempting to commit a crime.