The opinion of the court was delivered by
Mason, J. :A prosecution was begun before a justice of the peace in Ness county, charging the defendant, W. A. Jarvis, with a violation of chapter 271, Laws of 1901 (Gen. Stat. 1901, §§ 3922-3929), commonly known as the “pedler’s license act.” The defendant was tried, convicted, and sentenced. Pie asks this court to discharge him upon habeas .corpus, on the ground that the act referred to is unconstitutional.
The state files a motion.to quash the writ, and submits the whole matter upon the motion, urging that, even if the unconstitutionality of the statute were conceded, the petitioner could not be discharged in this proceeding, under the rule recently announced in In re Gray, 64 Kan. 850, 68 Pac. 658. The doctrine of the Gray case, however, does not extend to the case at bar. In that case the petitioner was arrested and held for trial under an ordinance which he claimed to be unconstitutional. This court refused to examine into and determine the question, so sought to be raised, in advance of the decision of the court before which the matter was pending. There the very question which this court was asked to decide was in a fair way to be speedily determined in the lower court, and the petitioner, if aggrieved by the decision, had his remedy in the ordinary course of judicial proceedings by appeal. The court held that, as the prisoner was held under process issued upon what was, in effect, an information, the statute did not authorize an inquiry into the validity of the custody upon *331habeas corpus. But in the present case the petitioner has been convicted and sentenced, and is held upon a commitment issued not upon an indictment, information, or complaint, but upon a final judgment.
It has been held in many well considered cases that even after conviction the defendant will not be' permitted to have the constitutionality of the act under which he is prosecuted investigated upon habeas corpus. The argument is that the judgment of the trial court upholding the validity of a statute in fact unconstitutional is not a nullity, but binds the parties unless vacated upon direct attack by proceedings in error. The greater weight of authority, however, favors the view that an unconstitutional law is a nullity — is no law at all — and that a conviction under it is not merely erroneous, but void, and subject to collateral attack upon habeas corpus. This view doubtless results more from a jealous regard for the personal liberty of the citizen, than from the force of the reasoning employed as applied to other subjects of litigation. The authorities upon both sides of the question are collated and discussed in a note to Koepke v. Hill, 87 Am. St. Rep. 161, 174, 157 Ind. 172, 60 N. E. 1039, and in a note to Hovey v. Elliott, 39 L. R. A. 449, 450, 145 N. Y. 126, 39 N. E. 841. But this case presents a special feature of the general question. The petitioner was convicted in justice’s court, and the time within which he might have appealed to the district court has gone by. (Gen. Stat. 1901, §5826.) He either has a remedy by habeas corpus, or he has no remedy at all. It may be urged that, having lost the remedy of appeal by permitting the time to elapse, he is not in a position to avail himself of this consideration. In response to this it may be said, however, .that the statute provides no appeal except upon the giving, within twenty-four hours, of a recognizance *332with sureties for appearance at the district court. In some cases this might be prohibitive.
Without at this time passing upon the question in any other aspect, we decide that where a defendant has been convicted of a misdemeanor in justice’s court and no appeal has been had and the time for an appeal has expired he may challenge the constitutionality of the statute under which he was convicted in an application to this court for á writ of habeas corpus.
The petitioner claims that the statute in question is unconstitutional upon several grounds, only,one of which it will be necessary to consider. It provides that it shall be a misdemeanor for any one to deal as a pedler without procuring and paying for a license from the county clerk, but expressly exempts from its operation the owner of goods peddling them in the county in which he is a resident taxpayer, or in any county immediately adjoining thereto. The statute, therefore, attempts to impose a tax on non-residents of the state from which certain residents of the state are exempted by the fact of such residence. This is an obvious discrimination in favor of the resident and against the non-resident, and is repugnant to section 2 of article 4 of the federal constitution, which provides that the citizens of each state shall be entitled to all privileges and immunities of citizens in the several states. (Ward v. Maryland, 12 Wall. 418, 20 L. Ed. 449; Fecheimer Bros. & Co. v. City of Louisville, 84 Ky. 306, 2 S. W. 65; Graffty v. The City of Rushville, 107 Ind. 502, 8 N. E. 609, 57 Am. Rep. 128.) The petitioner avers that he is a citizen and resident of the state of 'Georgia, and is therefore in a position to complain of the discrimination.
The motion to quash will be overruled, and the petitioner discharged.
All the Justices concurring.