Section 45(2) applies only when a person is prosecuted for an offence under the Act, not for offences under the Indian Penal Code.
RAJESH GEORGE MATHEWS v. STATE OF KERALA, REPRESENTED BY STATION HOUSE OFFICER, MALUR POLICE STATION, KANNURKerala High Court, single judge20192019 Cassie (KER HC) 12317para 8