
188 Cal.App.2d 68 (1961)
ROBERT C. HIGGINS, Appellant,
v.
STANDARD FEDERAL SAVINGS AND LOAN ASSOCIATION et al., Defendants; DESERT BRAEMAR, INC. (a Corporation), Respondent.
Civ. No. 6358. 
California Court of Appeals. Fourth Dist.  
Jan. 6, 1961.
 David M. McGahey and James Hollowell for Appellant.
 Thompson & Colegate and Robert D. Allen for Respondent.
 SHEPARD, J.
 Plaintiff-appellant Higgins brought two actions against defendant- respondent Desert Braemar, Inc., a corporation (hereinafter called "Desert"); one was to recover the reasonable value of plaintiff's services as general contractor in the construction of apartment buildings near Palm Springs; the other was to foreclose a claim of general contractor's lien on the same property against the same defendant for the same services. Other defendants were originally named, but all defendants except Desert were dismissed prior to trial. The two actions were consolidated for trial. From a judgment of nonsuit for defendant in each case, plaintiff appeals.
 [1] The rule of evidentiary weight on a motion for nonsuit is clearly delineated by our Supreme Court in Mitchell Camera Corp. v. Fox Film Corp., 8 Cal.2d 192, 197 [2-3] [64 P.2d 946], as follows:
 " 'Every favorable inference fairly deducible and every favorable presumption fairly arising from the evidence adduced must be considered as facts proved in favor of the plaintiff. [2] Where evidence is fairly susceptible of two constructions, or if one of several inferences may reasonably be made, the court must take the view most favorable to the plaintiff. [3] If contradictory evidence has been given it must be discarded. [Citation.] [4] The plaintiff must be given the benefit of every piece of evidence which tends to sustain his averments and such evidence must be weighed in a light most favorable to plaintiff's claim. [Citation.] *71 [5] Evidence whether erroneously admitted or not, if relevant to the issues joined, must be given the credit and benefit of its full probative strength, and any question arising from the fact of variation between the evidence of the witnesses cannot be raised or considered.' [Citation.]" (See also Wulfjen v. Dolton, 24 Cal.2d 878, 879-880 [1] [151 P.2d 840]; Van Buskirk v. McClenahan, 163 Cal.App.2d 633, 636 [1-4] [329 P.2d 924].)
 Reviewing the evidence with the rule in mind that every favorable inference fairly deducible and every favorable presumption fairly arising from the evidence adduced must be considered as facts proved in favor of plaintiff and that where evidence is fairly susceptible of two constructions or if one of several inferences may reasonably be made, the court must take the view most favorable to the plaintiff, the facts shown by the record are as follows: Desert is a corporation whose purposes include building, owning and operating cooperative apartment dwellings. Braemar Construction Company (hereinafter called "Braemar") is a corporation whose purposes include organizing, promoting and constructing cooperative apartment dwellings. It was wholly owned by Paul J. Broman and Mr. Hanousek and their wives. Paul J. Broman (hereinafter called "Broman") was the guiding spirit in the formation and operational conduct of both corporations and was, during all of the times herein mentioned, treasurer or president and managing agent of both Desert and Braemar.
 In 1956 Desert sold stock to the amount of $624,800 and borrowed $900,000 from Standard Federal Savings and Loan Association (hereinafter called "Standard"). The total of both of these sums was placed in the custody of Standard to pay bills for construction of a 100-unit apartment dwelling near Palm Springs. Braemar, at the behest of Desert, secured subcontractor bids for the proposed construction, and in April 1956 approached Higgins for the purpose of securing subcontractor bids on framing, hardware and clean-up. Higgins was accepted ultimately as the subcontractor on framing and clean-up.
 Broman was later warned by a state inspector of the necessity for a general contractor's license for Desert. Broman knew that neither he nor Desert nor Braemar had such license. He approached Higgins to take over the whole general contract. He knew that Higgins held a general contractor's license. Negotiations were had. He represented to Higgins that he held a general contractor's license. Later, on July *72 21, 1956, Broman, as president and moving spirit of both Desert and Braemar, caused a construction contract to be executed from Desert to Braemar whereby Braemar purported to become general contractor for the construction of the apartments. Broman signed the contract as president of Desert and also as president of Braemar. Both Desert and Braemar knew that neither Desert nor Braemar nor Broman had a general contractor's license. Higgins did not know this. The knowledge of Broman, in the case here at bar, is clearly chargeable to both Desert and Braemar. (McKenney v. Ellsworth, 165 Cal. 326, 329- 330 [132 P. 75]; Dicker v. Italo-American Oil Corp., 119 Cal.App. 451, 456 [6] [6 P.2d 550]; Verder v. American Loan Society, 1 Cal.2d 17, 27 [2] [33 P.2d 1081]; Frankish v. Federal Mortgage Co., 30 Cal.App.2d 700, 721 [8] [87 P.2d 90].)
 Responsive to Broman's representations and urgings, Higgins, early in July 1956, entered into an oral agreement to act as general contractor and commenced the work of construction. A tentative condition was attached to this contract that Higgins would secure a bond in the sum of $1,000,000. However, when it eventually developed that Higgins could not secure the bond, Higgins' work was not stopped. Higgins had, immediately after the date of the oral contract, taken out all construction permits in his own name. He continued right on with the work of general contractor in charge of construction with control of voucher approval for payrolls and other expenses, nominally in Braemar, as before.
 August 16, 1956, the parties purported to enter into a written contract making Higgins associate general contractor. No change in the management, operation or control which had theretofore obtained was made at the time this writing was executed, nor at any time thereafter until completion.
 Broman visited the job occasionally and to a minor degree improperly interfered with a few of the workmen to the detriment of the job and added difficulty for Higgins. Higgins did at times defer to Broman's requests respecting priorities to some particular preferred tenant. This deference, however, was no greater than might be expected from any general contractor in an attempt to keep the owner happy. No complaint is made of the work of construction done by Higgins. Higgins was never paid for his services as general contractor.
 Both the contracts of July 21, 1956, and of August 16, 1956, were void, and no action could be maintained on either of them. If upon a trial of the merits, the court should find that *73 Higgins' claim is, in truth and in fact, grounded on these illegal contracts, it would have no option but to deny him relief; not even a claim of estoppel would help him. (Holm v. Bramwell, 20 Cal.App.2d 332, 334 [1] [67 P.2d 114]; Harrison v. Butte Steel Buildings, Inc., 150 Cal.App.2d 296, 301 [310 P.2d 126]; Albaugh v. Moss Constr. Co., 125 Cal.App.2d 126, 131 [6] [269 P.2d 936]; Lewis & Queen v. N. M. Ball Sons, 48 Cal.2d 141, 149 [7] [308 P.2d 713]; Precision Fabricators, Inc. v. Levant, 182 Cal.App.2d 637, 643-644 [9-12] [6 Cal.Rptr. 395].)
 However, as was said in Norwood v. Judd, 93 Cal.App.2d 276, 286 [5] [209 P.2d 24]:
 "It must be remembered that these licensing statutes are passed primarily for the protection and safety of the public. They are not passed for the benefit of a greedy partner who seeks to keep for himself all of the fruits of the partnership enterprise to the exclusion of another partner entitled to share therein. Where the illegal transaction has been terminated, public policy is not protected or served by denying one partner relief against the other";
 And on page 289: "But the courts should not be so enamored with the Latin phrase 'in pari delicto' that they blindly extend the rule to every case where illegality appears somewhere in the transaction."
 [6a] Desert makes some claim that Higgins now claims more than he would have been entitled to recover under the purported agreement of August 16, 1956. As above noted, that agreement was void and Desert knew it was void. If the parties were not, in truth and in fact, acting under it, it cannot furnish grounds for either recovery or defense. If the trial court should be convinced, after weighing all of the evidence on its merits, that the purported contracts of July 21 and August 16 were not, in truth and in contemplation of law, acted upon and were not the real basis of Higgins' claim, and that the purported contracts did not in any way affect the value received by Desert from Higgins, the illegality of such contracts will not be used as a sword to strike down the legitimate claims of Higgins. (Stone v. Lobsien, 112 Cal.App.2d 750, 758 [11, 12] [247 P.2d 357].) [7] As was said in Goodhart v. Mission Publishing Co., 18 Cal.App. 394, 399 [123 P. 210]:
 "Before relief may be denied because of the unlawful nature of a contract, whereby some rule of public policy is claimed to have been violated, it must appear clearly that the case *74 comes within that class, and that the agreement of the parties in its essential obligations is tainted from improper motives."
 [6b] Higgins had sued for the reasonable value of his services. The trial court in a hearing on the merits has ample authority to adjust Higgins' recovery, if any, to an amount which is reasonable under all circumstances shown by the evidence.
 [8] Since the knowledge of Broman, the real organizer, the president and moving spirit of both Desert and Braemar, is chargeable to both corporations, the trial court might well have believed that both corporations knew beforehand that the proposed contracts of July 21 and August 16, 1956, would be void and unenforceable. Under the peculiar circumstances here involved, it would not have been unreasonable for the trial court to have concluded that Desert and Braemar, having wilfully caused these contracts to be executed in the face of their knowledge of such void character, intended and planned to entrap Higgins into a void agreement so that he could never collect. The trial court might also have concluded that Broman, the prime movant in both Desert and Braemar, and the president of both, was not being truthful when he said that at one time he was acting in behalf of Desert and that at another time he was acting in behalf of Braemar. Courts may and should, when the occasion and evidence demands it, cut straight through the tissue of sham documents presented and decide what the real truth of the matter is in order to accomplish justice under law. The mere fact that Higgins testified that at one time he thought he was dealing with Braemar is not finally conclusive upon the court. (2 Cal.Jur.2d,  148, p. 839; Nongard v. Scott, 176 Cal.App.2d 650, 656 [7] [1 Cal.Rptr. 526]; Sunset Milling & Grain Co. v. Anderson, 39 Cal.2d 773, 778 [4] [249 P.2d 24].) Higgins had no knowledge nor means of knowing what the private dealings of Broman, Desert and Braemar were. He was in no position to make an election to hold either Braemar or Desert. Until the full knowledge of their dealings became known, he could not be bound by an apparent election. (2 Cal.Jur.2d,  172, p. 872; McEwen v. Taylor, 106 Cal.App.2d 25, 29 [4] [234 P.2d 754]; J. M. Wildman, Inc. v. Stults, 176 Cal.App.2d 670, 675 [10] [1 Cal.Rptr. 651].)
 We are not here dealing with a decision on the merits. We are dealing with a judgment of nonsuit in which the various conflicting inferences, presumptions and evidence have not been weighed to the extent that would be done in a decision *75 on the merits. We are discussing what the trial court might have done under the reasonable and fair inferences deducible from the evidence dependent on what its conviction as to the truth might be.
 [9] The question of whether or not Braemar or Desert or Braemar and Desert were, under the circumstances of this case, in truth and in fact, acting as joint venturers with Higgins under the purported agreement of August 16, 1956, was primarily one of fact for the decision of the trial court after weighing the evidence on its merits. (Bunn v. Lucas, Pino & Lucas, 172 Cal.App.2d 450, 462 [3] [342 P.2d 508].)
 Both complaints alleged a contract with owner Desert through its agent, Broman. Depending on the view of the trial court as to the real truth here involved, it might have held that the alleged contracts of July 21, 1956, and August 16, 1956, never did, in law, come into existence because they were void; that being void and of no effect, they did not terminate the oral contract by which Higgins undertook to and did construct the apartments as the sole general contractor; that the real contract under which the parties were operating was the oral contract which Higgins did, in truth and in fact, complete; that Desert in knowingly entering into the unlawful agreement of July 21, and knowing and approving of the unlawful agreement of August 16, is estopped to deny that Broman and Braemar were at all times acting as the agent of and on behalf of Desert, and that any agreement entered into by them for construction of the apartments was, in truth and reality, the contract of Desert. The long-recognized rule was quoted in Vitoreno v. Corea, 92 Cal. 69, 73 [28 P. 95]: "For no man shall set up his own iniquity as a defense, any more than as a cause of action."
 As far as the record now shows, the court would have been fully justified in finding that all of Higgins' acts under the original oral contract were done lawfully; that he was a fully licensed general contractor; that his work was done properly and the job was substantially completed by him according to plans and specifications; that the only real trouble came from Broman's occasional interferences; that these troubles and interferences were no more than the acts of an owner; that these troubles were handled and rectified by Higgins; that Higgins sold even his own home to make up deficiencies caused by Broman improperly and maliciously withholding funds; and that Higgins acted in highest good faith towards *76 all parties concerned, including owner Desert, the materialmen, labor, and the subcontractors.
 The case of Rigney v. De La Salle Institute, 10 Cal.App.2d 492 [52 P.2d 579], cited by respondents, is clearly distinguishable in that in that case the contractor-agent was duly licensed, was known to the claimants to be duly licensed, was dealt with by them in that capacity, and there was no evidence from which any inference of culpable intention attached to the defendant institute.
 We conclude that giving full value to the inferences and presumptions available to Higgins, there was sufficient evidence to have supported a judgment in his favor and on the evidence. The matter should have been decided on the merits, and the granting of a nonsuit was improper.
 The judgments are reversed.
 Griffin, P. J., and Coughlin, J., concurred.
