fix race-condition NPE by inspection

This commit is contained in:
Eric House 2018-08-01 08:08:36 -07:00
parent 6a58a08bca
commit 0cc7d21ecb

View file

@ -115,7 +115,7 @@ public class BoardDelegate extends DelegateBase
private BoardUtilCtxt m_utils;
private boolean m_gameOver = false;
private JNIThread m_jniThread;
private volatile JNIThread m_jniThread;
private JNIThread m_jniThreadRef;
private JNIThread.GameStateInfo m_gsi;
@ -1817,7 +1817,9 @@ public class BoardDelegate extends DelegateBase
@Override
public boolean engineProgressCallback()
{
return ! m_jniThread.busy();
// return true if engine should keep going
JNIThread jnit = m_jniThread;
return jnit != null && !jnit.busy();
}
@Override