From 73851b285e2909daf0e3c5d909e7271afd850bfa Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 1 Dec 2014 07:01:10 -0800 Subject: [PATCH] fix a couple of NPEs --- .../XWords4/src/org/eehouse/android/xw4/BoardDelegate.java | 1 + .../XWords4/src/org/eehouse/android/xw4/ConnStatusHandler.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java index 53f949402..f4d5ab54f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java @@ -269,6 +269,7 @@ public class BoardDelegate extends DelegateBase }; ab.setNegativeButton( R.string.button_rematch, lstnr ); } else if ( DlgID.DLG_CONNSTAT == dlgID && + null != m_connTypes && m_connTypes.contains( CommsConnType.COMMS_CONN_RELAY ) ) { lstnr = new DialogInterface.OnClickListener() { public void onClick( DialogInterface dlg, diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/ConnStatusHandler.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/ConnStatusHandler.java index f360d4764..da2efed5d 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/ConnStatusHandler.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/ConnStatusHandler.java @@ -171,7 +171,7 @@ public class ConnStatusHandler { public static String getStatusText( Context context, CommsConnTypeSet connTypes ) { String msg; - if ( 0 == connTypes.size() ) { + if ( null == connTypes || 0 == connTypes.size() ) { msg = LocUtils.getString( context, R.string.connstat_nonet ); } else { StringBuffer sb = new StringBuffer();