The only question presented by this appeal is as to whether the lower court erred in refusing to dissolve the temporary injunction issued in this case.
From the showing made by the defendants in support of their *511motion to dissolve the temporary injunction, it clearly appears that the plaintiff, who was the defendant in the justice’s court against whom the judgment now sought to he annulled was rendered, after the judgment was rendered appeared in said justice’s court, and moved the court to set aside the same. This motion was heard and determined by the justice. The decision being against plaintiff herein, he appealed to the district court. For some reason his appeal to the district court was dismissed, and the judgment of the justice thereby affirmed. It thus appears that the plaintiff not only had a legal remedy by appeal to the district court from the judgment of the justice, but that he availed himself of it. Whatever defects there may have been in the summons issued by the justice were cured by Schilling’s appearance, and moving the justice to set aside the judgment, and his subsequent appeal to the district court. (Gage v. Maryatt, 9 Mont. 265, 23 Pac. 337.)
The respondent says that his action to annul the judgment of the justice is based on two grounds, to wit, the alleged defect in the justice’s summons, and the inability of the defendant corporation to maintain this action by reason of its failure to comply with the law of the state regulating the right of foreign corporations to contract and sue upon contracts in this state, as shown in the foregoing statement.
But in reply to this we may say that Schilling could have made this defense in the justice’s court, if there is any merit in it, or he could have made use of this defense as a ground for setting aside the judgment in the justice’s court, and had both these questions tried de novo in the district court on his appeal. So that whatever merit there may be in the contention that the claim sued on in the justice’s court was invalid, and that the justice had no authority in law to enter judgment thereon, because of the corporation claimant having failed to comply with the law in relation to foreign corporations doing business in this state, we think it cannot avail the plaintiff in tnis action, for the reason given above.
The respondent in this suit contends that the court below *512committed no error in refusing to dissolve the injunction, because, he says, this court has time and again held that the granting or refusing to grant a temporary injunction is a matter of discretion.
This court has frequently held that the granting of a temporary injunction in a proper case, and upon a reasonable showing, is a matter within the discretion of the lower court. But by “discretion” in such cases is meant a sound judicial discretion. We certainly have never held that it was a matter of discretion whether a district court would grant a temporary injunction in any and all kinds of cases, with or without a reasonable showing. When it appears from the nature of the case and all the facts that a party is not entitled to an injunction, the granting thereof is error, because unauthorized. The granting of an injunction is not, in such cases, a matter of discretion.
We think the court erred in refusing to dissolve the temporary injunction on the showing of the defendants.
The order appealed from is reversed, and the cause remanded, with direction to dissolve the injunction.
Reversed and Remanded.
Hunt and Buck, JJ., concur»