A. 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 shall not be a dangerous animal or potentially dangerous animal within the meaning of this chapter. An animal shall not be a dangerous animal or a potentially dangerous animal within the meaning of this chapter if the injury inflicted by the animal 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. B. No owner of a dangerous animal shall be held criminally liable under this chapter for injuries inflicted by said owner's animal to any human while on the owner's property if said owner is in compliance with the provisions of this chapter at the time of the injuries being inflicted.