Skip to content
Snippets Groups Projects
Commit bcc65a1b authored by Michael Eischer's avatar Michael Eischer
Browse files

Sanity check that only active timers are stopped

parent 1edad942
No related branches found
No related tags found
No related merge requests found
......@@ -119,7 +119,10 @@ public class REFITScheduler extends Thread implements REFITSchedulerFacade {
if (this != Thread.currentThread()) {
throw new IllegalArgumentException("Timeout must only be set by the task itself!");
}
timeouts.remove(timer);
boolean removed = timeouts.remove(timer);
if (!removed) {
throw new IllegalStateException("The timer is not active!");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment