mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
fix NPE when game isn't connected yet
This commit is contained in:
parent
37a853c8a4
commit
bdd92baf55
2 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue