diff --git a/xwords4/android/XWords4-dbg/AndroidManifest.xml b/xwords4/android/XWords4-dbg/AndroidManifest.xml index d12be4963..f414c6e94 100644 --- a/xwords4/android/XWords4-dbg/AndroidManifest.xml +++ b/xwords4/android/XWords4-dbg/AndroidManifest.xml @@ -22,7 +22,7 @@ to come from a domain that you own or have control over. --> diff --git a/xwords4/android/XWords4/AndroidManifest.xml b/xwords4/android/XWords4/AndroidManifest.xml index b12e53ab3..4b90bc3a8 100644 --- a/xwords4/android/XWords4/AndroidManifest.xml +++ b/xwords4/android/XWords4/AndroidManifest.xml @@ -22,7 +22,7 @@ to come from a domain that you own or have control over. --> diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java index 76b831b5c..5ad82bec7 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java @@ -286,6 +286,7 @@ public class BTService extends XWService { public static void inviteRemote( Context context, String btAddr, NetLaunchInfo nli ) { + Assert.assertTrue( null != btAddr && 0 < btAddr.length() ); Intent intent = getIntentTo( context, BTAction.INVITE ); String nliData = nli.toString(); intent.putExtra( GAMEDATA_KEY, nliData ); @@ -311,16 +312,20 @@ public class BTService extends XWService { CommsAddrRec targetAddr, int gameID ) { int nSent = -1; - if ( null != targetAddr ) { - String btAddr = getSafeAddr( targetAddr ); + Assert.assertNotNull( targetAddr ); + String btAddr = getSafeAddr( targetAddr ); + if ( null != btAddr && 0 < btAddr.length() ) { Intent intent = getIntentTo( context, BTAction.SEND ); intent.putExtra( MSG_KEY, buf ); intent.putExtra( ADDR_KEY, btAddr ); intent.putExtra( GAMEID_KEY, gameID ); context.startService( intent ); nSent = buf.length; - } else { - DbgUtils.logf( "BTService.enqueueFor(): targetAddr is null" ); + } + + if ( -1 == nSent ) { + DbgUtils.logf( "BTService.enqueueFor(): can't send to %s", + targetAddr.bt_hostName ); } return nSent; }