Irvine, C.
This was an action by the plaintiff in error against the defendant in error to recover commissions which the plaintiff claimed he had earned as a real estate broker. When the plaintiff rested, the defendant moved for a nonsuit. This *846motion was sustained by the court, and a judgment of dismissal entered, against the plaintiff’s exception, without taking a verdict from the jury.' It is contended that under our code this was improper practice, and we shall examine that question before inquiring into the merits of the case.
It is broadly contended that the court has no power to subject the plaintiff to an involuntary nonsuit or to euter a judgment of dismissal on the ground that the plaintiff’s evidence is insufficient to establish a cause of action. Were we without guide from the statutes, the question would upon authority be difficult of solution. The supreme court of the United States (Elmore v. Chymes, 1 Pet., 469) has determined that the federal courts have no power to subject the plaintiff to an involuntary nonsuit. Many of the state courts take the same view. On the other hand, in many states such a practice has been sustained as avoiding an unnecessarily circuitous procedure. (See authorities collated, 16 Am. & Eng. Ency. of Law, 733.) But the provisions of our Code of Civil Procedure, to our minds, afford a ready solution of the question. Section 430 provides: “An action may be dismissed without prejudice to a future action. First — By the plaintiff, before the final submission of the case to the jury, or to the. court, where the trial is by the court. Second — By the court, where the plaintiff fails to appear on the trial. Third — By the court, for want of necessary parties. Fourth — By the court, on the application of some of the defendants where there are others whom the plaintiff fails to prosecute with diligence. Fifth — By the court, for disobedience by the plaintiff of an order concerning the proceedings in the action. In all other cases, upon the trial of the action, the decision must be upon the merits.” By virtue of this section, in the five cases stated, a judgment of dismissal without prejudice may be entered by the court; and by the last sentence of the section such a judgment cannot be entered in other cases. At common law a nonsuit was not a bar to a future action, and the evi*847dent purpose of the framers of the code was to change the law in order to lead every case to a final judgment which should be a bar except where, for sufficient reasons, other provision has been made. This is the view taken elsewhere under similar statutes. {Byrd v. Blessing, 11 O. St., 362; Case v. Hannahs, 2 Kan., 490; Mulhern v. Union P. R. Co., 2 Wyo., 465.) Where the evidence is insufficient to warrant a verdict for the plaintiff the court may, and should, instruct the jury to return a verdict for the defendant; but it has no authority without a verdict to enter a nonsuit and judgment of dismissal. It does not follow, however, that this judgment should be reversed because of this error. Section 145 of the Code provides: “The court in every stage of an action must disregard any error or defect in the pleadings or proceedings which does not affect the substantial rights of the adverse party; and no judgment shall be reversed or affected by reason of such error or defect.” It follows that if the state of the evidence was such that the court should have directed a verdict for the defendant and entered judgment upon that verdict, the error is without prejudice and must be disregarded. {Byrd v. Blessing and Case v. Hannahs, supra.)
The evidence tends to show that the plaintiff, a real estate broker, had entered into a contract with one Mills to procure for him a purchaser, either by way of sale or exchange, for certain property in the city of Omaha. In the language of real estate brokers, Mills had “ listed ” his property with the plaintiffs for sale or exchange. Some time thereafter the defendant approached plaintiff to ascertain what property plaintiff had for exchange. He was informed of Mills’ property, and the defendant then listed his property with the plaintiff, knowing, it was alleged, that plaintiff was to receive a commission from Mills, and agreeing with that knowledge to himself pay to plaintiff one-half the usual commission. This arrangement having been made, the plaintiff and defendant went .to .examine *848Mills’ property. They were met by Mrs. Mills, who refused to permit them to enter. Returning, they met Mills, who was introduced to defendant by plaintiff, plaintiff informing Mills where they had been, their object, and how it had been defeated. They were then informed by Mills that Mrs. Mills was unwilling to dispose of the property, but that she had joined in a conveyance to one Miller, and that a reconveyance from Miller to Mills was then held in escrow. Mills proposed to obviate the difficulty arising from Mrs. Mills’ unwillingness to convey, by destroying the reconveyance and causing Miller to convey directly to the defendant. Subsequently a memorandum of agreement was signed by Mills and the defendant, but defendant refused to perform it, giving as a reason that he had taken counsel and learned the title would not be good, and that he did not wish the property. The record does not disclose the actual condition of the title, except that there had been a conveyance from Mills and wife to Miller, which it would seem from some of the evidence was for the purpose of securing a debt; that Miller had executed a reconveyance, and that that re-conveyance had not been delivered, but was in possession of one Wakefield, and held by him as security for the payment of other moneys. Under this evidence, had plaintiff produced a purchaser willing and able to take defendant’s property? We think not. In the first place, assuming the title to have been in Mills, Mills did not offer a valid conveyance to defendant. It is true that the defendant was aware of this when he entered into the written memorandum. But the method proposed for making title was plainly a device to defraud Mrs. Mills of her dower if not also of homestead rights. The plaintiff was cognizant of this device and of its purpose. Had the transaction been completed, Mrs. Mills would have had her remedy against the defendant who was also a party to the fraud; and while the defendant can claim no relief because of his participation in such an unlawful transaction, he was not bound to *849consummate it. He had a right, which he exercised, to refuse to consummate the fraud, and Mills being unable to confer upon him even the apparent title, except through such fraudulent device, he was not a purchaser able to take the property in a lawful way. He was merely one willing to purchase by unlawful means. A production of such a purchaser does not entitle the agent to his commission. The greater part of the argument on behalf of plaintiff is addressed to .propositions which assume that a person willing and able to take the property had been procured. We are cited to certain eases holding that a brokér may recover his commission although the title proves defective, and that the refusal of a wife to join in a conveyance is no bar to the recovery of commissions; but the defects and refusal referred to in those cases relate to the title to the principals’ land, and not to such features with relation to laud offered in exchange therefor. In the case of an exchange a defect in title to the land offered in exchange is as good a defense as would be proof that the purchaser produced had no means of buying except with counterfeit money. But we have taken a view very favorable to the plaintiff in assuming that title had been shown in Mills. This court has held that where a deed absolute in form is executed to secure a debt, the case is different from an ordinary mortgage, and title passes to the grantee. (Gallagher v. Giddings, 33 Neb., 222.) Such a conveyance had been made to Miller, and while a reconveyance had been executed, it had not been delivered, but had been placed in escrow as security for a further debt. The details of these transactions very meagerly appeared in evidence. It is unnecessary to consider where the legal title was reposed. It is sufficient that if the legal title were not outstanding there were substantial outstanding equities which Mills did not propose to divest in a regular or legal manner. The evidence was, therefore, of such a character that a verdict should have been directed *850for the defendant, and the error in the former proceedings, was not prejudicial.
Judgment affirmed.