From eb79393dc1dfe35c72b65bfa86f7085e7a6621de Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 21 Mar 2019 09:12:32 -0700 Subject: [PATCH] fix a couple of random crashes a race condition and a misunderstanding --- .../src/main/java/org/eehouse/android/xw4/BTService.java | 6 ++++-- .../main/java/org/eehouse/android/xw4/BoardDelegate.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BTService.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BTService.java index 4b5cfb603..f438d8d2b 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BTService.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BTService.java @@ -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; diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java index e295f27b9..e447109c4 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java @@ -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() {