The plaintiff is a resident of Pennsylvania; the defendant, a foreign corporation. The contract sued upon was made in Illinois, and was to be performed there. These undisputed facts deprive the court of jurisdiction, and the objection need not be specially pleaded in defense. It is sufficient that it is made when the facts appear at the trial. Robinson v. Navigation Co., 112 N. Y. 315, 19 N. E. 625; Perry v. Transfer Co. (Com. Pl.) 19 N. Y. Supp. 239; Bogert v. Engine Works, 28 App. Div. 463, 51 N. Y. Supp. 118; Manda v. Wells, Fargo & Co., 21 Misc. Rep. 308, 47 N. Y. Supp. 182. The provisions of the Code do not originate, but simply restrain, the original jurisdiction. Thus, it is provided by section 1780 that an aotion may be maintained against a foreign corporation by another foreign corporation, or by a nonresident, “in one of the following cases only.” The word “only” is inserted as a word of restriction, and implies a general jurisdiction, purposely narrowed and restrained. Hopper v. Hopper, 125 N. Y. 400, 26 N. E. 457, citing Robinson v. Navigation Co., supra.
The plaintiff’s brief has been carefully examined in connection with the evidence taken, but nothing has been found to obviate the objection urged against the jurisdiction of the court. The point that the defendant waived the objection by not raising it in the answer is unavailing, for an objection to the jurisdiction of the court need not be raised by answer or demurrer. Code, § 499. Consent cannot confer jurisdiction over the subject-matter when none exists by law, and there can be no waiver of rights by laches in a case where consent would be wholly nugatory. Cooley, Const. Lim. (6th *339Ed.) 491, 492. There is no alternative but to dismiss the complaint on the objection made to the want of power to adjudicate against the defendant.
As the objection does not appear on the face of the complaint, but was established, as it had to be, at the trial, costs follow as of course. 5 Enc. Pl. & Prac. 119; Harriott v. Transportation Co., 1 Daly, 377.
Ordered accordingly.