Disallow negative timeouts for Timer::tick
authorMikko Rasa <tdb@tdb.fi>
Sun, 31 Jan 2016 15:20:36 +0000 (17:20 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 31 Jan 2016 15:20:36 +0000 (17:20 +0200)
source/time/timer.cpp

index be1d1ed3291482b453ab03d228f5961eb80b8cab..e0af57cc78fcc41363632e169e33a8219653e9f1 100644 (file)
@@ -69,6 +69,9 @@ void Timer::tick()
 
 void Timer::tick(const TimeDelta &timeout)
 {
+       if(timeout<zero)
+               throw invalid_argument("Timer::tick");
+
        do_tick(timeout);
 }