Nothing is an offence which is done by a Judge when acting judicially in the exercise of any power which is, or which in good faith he believes to be, given to him by law.
Section 77 IPC
Act of Judge when acting judicially
The Indian Penal Code, 1860 is repealed. It was replaced by The Bharatiya Nyaya Sanhita, 2023 from 1 July 2024; this provision still applies to matters that arose before then.