fix a couple of random crashes

a race condition and a misunderstanding
This commit is contained in:
Eric House 2019-03-21 09:12:32 -07:00
parent 83b8169a6b
commit eb79393dc1
2 changed files with 5 additions and 3 deletions

View file

@ -893,9 +893,11 @@ public class BTService extends XWJIService {
&& Arrays.equals( mData, other.mData );
if ( result ) {
if ( null != mMsgID && !mMsgID.equals( other.mMsgID ) ) {
Log.e( TAG, "hmmm: identical but msgIDs differ: new %s vs old %s",
Log.d( TAG, "hmmm: identical but msgIDs differ: new %s vs old %s",
mMsgID, other.mMsgID );
Assert.assertFalse( BuildConfig.DEBUG );
// new 0:0 vs old 2:0 is ok!! since 0: is replaced by
// 2 or more when device becomes a client
// Assert.assertFalse( BuildConfig.DEBUG ); // fired!!!
}
}
return result;

View file

@ -1358,7 +1358,7 @@ public class BoardDelegate extends DelegateBase
break;
case MESSAGE_NOGAME:
final int gameID = (Integer)args[0];
if ( gameID == m_gi.gameID && !isFinishing() ) {
if ( null != m_gi && gameID == m_gi.gameID && !isFinishing() ) { // NPE
post( new Runnable() {
@Override
public void run() {