If a public employee acts under the apparent authority of a law that is unconstitutional, invalid or inapplicable, he is not liable for an injury caused thereby except to the extent that he would have been liable had the law been constitutional, valid and applicable.

L.1972, c. 45, s. 59:3-4