client: fix npe when puzzle solver hasn't been executed yet

If the executor waits a while until it starts executing the puzzle
solver, the stopwatch will have a null value when hasExceededWaitDuration is called the next frame.
This commit is contained in:
Lotto
2019-04-04 18:40:33 +02:00
parent 94d679fbbc
commit 45777a1782

View File

@@ -78,7 +78,7 @@ public class PuzzleSolver implements Runnable
public boolean hasExceededWaitDuration()
{
return stopwatch.elapsed().compareTo(MAX_WAIT_DURATION) > 0;
return stopwatch != null && stopwatch.elapsed().compareTo(MAX_WAIT_DURATION) > 0;
}
public boolean hasFailed()