(2) If the plaintiff fails to prove the service of the said notice at least one month before action brought he or she shall be non-suited with costs. However, if the defendant at any time before such action is brought, tenders to the plaintiff or pays into court to the credit of the plaintiff sufficient compensation for the wrong or injury in respect of which the action is brought, and the plaintiff refuses to accept such compensation, the court shall, upon proof of the circumstances, give judgment for the plaintiff only for the amount so tendered or paid into court, subject to deduction therefrom of the costs of the action.