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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user