fix NPE when game isn't connected yet

This commit is contained in:
Eric House 2018-12-28 07:09:15 -08:00
parent 37a853c8a4
commit bdd92baf55
2 changed files with 8 additions and 3 deletions

View file

@ -1486,8 +1486,9 @@ public class BoardDelegate extends DelegateBase
public void onStatusClicked()
{
CommsAddrRec[] addrs = XwJNI.comms_getAddrs( m_jniGamePtr );
CommsAddrRec addr = null != addrs && 0 < addrs.length ? addrs[0] : null;
final String msg = ConnStatusHandler
.getStatusText( m_activity, m_connTypes, addrs[0] );
.getStatusText( m_activity, m_connTypes, addr );
post( new Runnable() {
@Override

View file

@ -553,10 +553,14 @@ public class ConnStatusHandler {
result = WiDirService.formatNetStateInfo();
break;
case COMMS_CONN_BT:
result = addr.bt_hostName;
if ( null != addr ) {
result = addr.bt_hostName;
}
break;
case COMMS_CONN_SMS:
result = addr.sms_phone;
if ( null != addr ) {
result = addr.sms_phone;
}
break;
default:
break;