
71 Cal.App.2d 783 (1945)
J. L. GARNETTE, Appellant,
v.
CARL MANKEL, Respondent.
Civ. No. 7162. 
California Court of Appeals. Third Dist.  
Nov. 27, 1945.
 Chas. L. Gilmore for appellant.
 Fontaine Johnson for Respondent.
 PEEK, J.
 This is an action by appellant, J. L. Garnette, against respondent Carl Mankel, for the wrongful conversion of a power shovel. From the judgment denying the relief sought he has appealed.
 The record discloses that one Charles Hopper Brown was the lessee of certain mining property in Placer County, California. He executed a sublease to one D. D. Pettigrew, who entered upon the premises and conducted the business of mining chrome ore, under the name of War Metals Development, Ltd., a limited copartnership. Said sublease provided in part: "Should Second Party [Pettigrew] desire to cease and abandon operations hereunder, he may do so at any time upon giving thirty days notice in writing of his intention so to do and, if he shall have kept all the terms and conditions hereof and be not in default in any particular hereunder, he shall have the right to remover his machinery and equipment placed by him upon the premises, within Sixty days after the giving of such notice." Brown assigned his interests in the primary lease and the Pettigrew sublease to appellant Garnette. Thereafter Pettigrew dealt exclusively with appellant as his lessor. Respondent Mankel was the owner of certain mining machinery, including a heavy duty Northwest 3/4-yard shovel. On May 16, 1942, in consideration of a guaranteed monthly rental and a percentage of the royalties to be derived from the mining operations, *785 he entered into an agreement with War Metals Development, Ltd., through Pettigrew, whereby he leased certain equipment, including said shovel, to the copartnership for a term of three years, with an option to purchase. The contract further provided that the equipment was to be used exclusively on said mining premises and that the same should retain its character as personal property; that it should be returned to lessor by the lessee at the end of the term or sooner termination of the lease; that if the lessee should default in any of the provisions of the agreement, or if the mining operations should close or prove unprofitable and the lessor elect to terminate the lease and give thirty days' notice in writing, said lessor could go upon the premises and retake possession of the equipment. In February, 1943, Pettigrew defaulted on his royalty payments to appellant. On or about May 13, 1943, appellant went into possession of the premises and took over the operation thereof. Meanwhile War Metals Development, Ltd. defaulted on the payments to respondent under the lease for the shovel, and on or about May 9, 1943, respondent, with Pettigrew's consent, repossessed himself of the shovel, and removed it from the mining property.
 Two issues are presented for determination: First, whether, as appellant contends, the shovel, when placed on the mining premises, became a part of the realty under Public Resources Code, section 2601, and thereby passed to appellant upon the termination of the lease or, as contended by respondent, it retained its character as personalty by reason of the understanding of the parties to the transaction under which it was placed on said premises, to which transaction appellant was a total stranger; and secondly, whether or not respondent is precluded from asserting his ownership of the shovel by reason of the failure of the copartnership to obtain a permit under the provisions of the Corporate Securities Act for the issuance of the royalty interests involved in the lease of the shovel.
 [1] Public Resources Code, section 2601 (formerly Civ. Code,  661), provides in effect that all machinery and tools used in working or developing a mine are to be deemed affixed to the mine. However, it is a well-recognized exception to the rule specified in said section that the parties themselves may, in their dealings with personal property annexed to or used in connection with mining premises, agree that it shall be considered as realty or personalty and that the *786 courts will give to such property the character which the parties themselves have fixed upon it. (Hendy v. Dinkerhoff, 57 Cal. 3 [40 Am.Rep. 107].) In other words said code provision does not operate independently as a transfer of title. (Byron-Jackson Iron Works v. Hoge, 49 Cal.App. 700, 703-704 [194 P. 45].)
 [2] The factual situation herein presented is not wholly unlike the question before the Supreme Court in the early Hendy case (57 Cal. 3). There Hendy had leased mining equipment to one Lampson, the lessee of Dinkerhoff. Upon the lessee's default, Dinkerhoff took possession of the premises as well as the equipment leased by Hendy. Dinkerhoff refused Hendy's demand for a return of the machinery and the action by Hendy followed. The court held that as between Hendy and the lessee the property remained personalty; that Dinkerhoff stood in the same shoes as his lessee and that the machinery remained as personalty, whether in the hands of Dinkerhoff or the lessee.
 In the Byron-Jackson case (49 Cal.App. 700), this court, relying upon the Hendy case (57 Cal. 3), likewise held that equipment placed on mining property under a conditional sales contract, providing that title to the machinery was to remain in the seller until the purchase price had been paid, did not attach to the premises but remained as personalty in the hands of the lessee, and that the seller's action for the return of the property or the value thereof was well founded.
 Following the conclusion in the Byron-Jackson case, this court, in Western Mach. Co. v. Graetz, 42 Cal.App.2d 296, 300 [108 P.2d 711] (hearing in the Supreme Court denied), again reiterated the general rule, holding that leased mining equipment, title to which was to remain in the seller, did not attach to the realty, and further observed that as no interest in the leased machinery was shown to have been gained by the owners of the premises its character as personalty continued as to them.
 We find nothing in the present case to take it out of the rule enunciated in the cases previously cited.
 [3] Appellant's second assignment of error is based on the theory that respondent's right to the shovel is predicated on his written agreement with the War Metals Development, Ltd., and that such agreement being void by reason of the fact that the copartnership failed to procure from the Commissioner *787 of Corporations a permit for the issuance of the securities provided for in the agreement, as required by the Corporate Securities Act, respondent can assert no rights by virtue of said agreement.
 Respondent is not chargeable with the copartnership's dereliction, if such it were, in failing to secure the permit. While respondent is presumed to know the law, he may not be presumed to know the fact of the noncompliance therewith. He is not in pari delicto with the copartnership but is one of the very persons whom the law was designed to protect. As stated in Hemmeon v. Amalgamated Copper Mines Co., 95 Cal.App. 400, 401-402 [273 P. 74]:
 "True, respondent must be presumed to have known the law requiring the possession of a permit as a prerequisite to the issuance and sale of securities, but it does not follow that she should be presumed to have known the fact that appellant had violated the law. ... Until the contrary appears, it will be presumed that a person is innocent of crime or wrong, and that the law has been obeyed. (Code Civ. Proc.,  1963.)" See, also, Tatterson v. Kehrlein, 88 Cal.App. 34, 49-50 [263 P. 285]; Austin v. Hallmark Oil Co., 21 Cal.2d 718, 727 [134 P.2d 777]; Randall v. California L. B. Syndicate, 217 Cal. 594, 597 [20 P.2d 331]; Parmely v. Boone, 35 Cal.App.2d 517, 520 [96 P.2d 164].)
 [4] Appellant's further contention that as a creditor of Pettigrew, his lessee, he is entitled to attack the validity of the rental agreement, is likewise without merit. He cannot urge the invalidity of the agreement while relying on its validity to show a contractual relationship between Pettigrew and respondent which alone would entitle him (appellant) to claim an interest in the shovel. (Austin v. Hallmark Oil Co., supra.)
 The judgment is affirmed.
 Adams, P. J., and Thompson, J., concurred.
