107. If an application is made to quash a conviction, order or other proceeding made or had by or before a justice of the peace, on the ground that such justice has exceeded his jurisdiction, the court or judge who renders judgment on such proceeding may, as a condition of quashing the conviction, order, if the court or judge thinks fit so to do, that no action shall be brought against the justice of the peace, by or before whom such conviction, order or other proceeding was made or had, or against any officer acting thereunder or under any warrant issued to enforce any such conviction or order.
R. S. 1964, c. 35, s. 101.