California Code
CHAPTER 4 - Object of a Contract
Section 1599.

1599. Where a contract has several distinct objects, of which one at least is lawful, and one at least is unlawful, in whole or in part, the contract is void as to the latter and valid as to the rest.

(Enacted 1872.)