Defendant appeals from a judgment awarding plaintiff damages for defendant’s alleged breach of a written contract relating to the remodeling of plaintiff’s premises. The amount of the judgment represented the cost to plaintiff to complete the work, less the balance of the unpaid portion of the contract.
In plaintiff’s original complaint, which was merely for damages for the alleged breach of the contract, no issue was raised concerning the illegality thereof. However, defendant pleaded such illegality in that he was not a licensed contractor by way of an affirmative defense, alleging that plaintiff knew such fact at the time the contract was executed; and that the failure by plaintiff to pay for additional work to the roof of his dwelling prevented defendant’s further performance. By cross-complaint defendant alleged that he had furnished the work and labor at plaintiff’s request and that plaintiff thereby became indebted to him for the reasonable value thereof. Thereafter, by an amended complaint, plaintiff pleaded the defendant’s lack of a contractor’s license; that plaintiff did not discover the fact until after cessation of work by the defendant; that he was unwilling to continue under said contract because of such illegality; that at the time defendant ceased work plaintiff was not in default and was ready and willing to perform the contract until he discovered the fact of illegality.
The testimony shows that plaintiff and defendant entered into a written agreement whereby defendant agreed to do certain remodeling work on a two-story building belonging to the plaintiff. The agreed price was $4,000, of which $1,000 was to be paid on the day after the agreement was made, *281$1,000 upon completion of the downstairs and $2,000 upon completion of the contemplated work. The first payment of $1,000 was made as agreed, but no other payment was made by plaintiff. Thereafter a supplemental agreement was made whereby defendant agreed to do additional work for the sum of $1,600 which was paid upon execution of the agreement. Sometime thereafter a dispute arose between the parties concerning the repair of damage to the roof which plaintiff contended was caused by defendant’s removal of certain supports. Upon plaintiff’s refusal to pay to defendant the amount demanded by him for the repair of the same, the defendant ceased work. On the following day plaintiff discovered that defendant was not a licensed contractor and that the contract was illegal. Subsequently plaintiff employed others and the work was completed. The findings of fact followed the evidence as summarized.
Defendant’s contention that the contract between the parties was illegal and void, and for that reason unenforceable, is without merit. The rule is well established in this state that “. . . when the Legislature enacts a statute forbidding certain conduct for the purpose of protecting one class of persons from the activities of another, a member of the protected class may maintain an action notwithstanding the fact that he has shared in the illegal transaction. The protective purpose of the legislation is realized by allowing the plaintiff to maintain his action against a defendant within the class primarily to be deterred. In this situation it is said that the plaintiff is not in pari delicto.” (Lewis & Queen v. N. M. Ball Sons, 48 Cal.2d 141, 153 [308 P.2d 713].) The court there further held that an owner was a member of the protected class. Hence in the present case both the pleadings and proof that plaintiff was the owner of the building and was ignorant of the fact that defendant did not have a contractor’s license support the finding that plaintiff was not in pari delicto with the defendant.
Defendant then goes one step further and contends that since the contract was void because of its illegality, it cannot be enforced by either party and hence the innocent party may recover only that for which he had received no value. Under the circumstances defendant’s disagreement with the rule in the case of Owens v. Haslett, 98 Cal.App.2d 829 [221 P.2d 252] (hearing in the Supreme Court denied), is quite understandable. Nevertheless it is the rule that,
*282“Where the illegality of a bargain is due to (a) facts of which one party is justifiably ignorant and the other party is not, or (b) statutory or executive regulations of a minor character relating to a particular business which are unknown to one party, who is justified in assuming special knowledge by the other party of the requirements of the law, the illegality does not preclude recovery by the ignorant party of compensation for any performance rendered while he is still justifiably ignorant, or for losses incurred or gains prevented by non-performance of the bargain.” (Best., Contracts, § 599.)
It necessarily follows that under the facts and circumstances of the record before us, plaintiff comes within the exception to the general rule, and hence was properly allowed damages as in an action predicated upon an alleged wrongful breach of contract.
Defendant’s final contention, that the findings of the court were not supported by the evidence, is likewise without merit. Viewing the evidence as we must in the light most favorable to respondent, it appears that defendant’s cessation of work under the contract was not due to a default or breach by the plaintiff and that at the time of defendant’s cessation the work was approximately one-half completed. Defendant’s testimony to the contrary merely created a conflict in the evidence which the court resolved against him. The attack upon the finding that defendant ceased performance without cause is also without merit since the finding was unnecessary to the decision of the case and was nothing more than another way of stating the prior finding that defendant’s cessation of the work was not due to a breach by the plaintiff. The record amply supports the conclusion that defendant knew the contract was illegal when he began the work; his cessation of work was not caused by its illegality; he continued the remodeling until a dispute arose over the repair to the roof; at the time he ceased work he had not completed the downstairs apartment and hence he was not entitled to payment from plaintiff at that time; the plaintiff did not discover the illegality until after the cessation of work; and finally there was testimony as to the estimated value of defendant’s work and labor at the time he left.
The judgment is affirmed.
Van Dyke, P. J., and Schottky, J., concurred.
A petition for a rehearing was denied November 1, 1957.