2402. In non-marine insurance, any general clause whereby the insurer is released from his obligations if the law is violated is deemed not written, unless the violation is an indictable offence.
Any clause of a policy whereby the insured consents, in case of loss, to effect an assignment of claim to his insurer that would result in granting his insurer more rights than he would have under the rules on subrogation is also deemed not written.