If it appears during a trial that the court has no jurisdiction of the offense, or that the facts charged in the indictment do not constitute an offense, the jury shall be discharged. The accused shall also be discharged, but such discharge shall be no bar in any case to a prosecution before the proper court for any offense unless termination of the former prosecution was improper.
Tex. Code Crim. Proc. § 36.11