mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +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()
|
public void onStatusClicked()
|
||||||
{
|
{
|
||||||
CommsAddrRec[] addrs = XwJNI.comms_getAddrs( m_jniGamePtr );
|
CommsAddrRec[] addrs = XwJNI.comms_getAddrs( m_jniGamePtr );
|
||||||
|
CommsAddrRec addr = null != addrs && 0 < addrs.length ? addrs[0] : null;
|
||||||
final String msg = ConnStatusHandler
|
final String msg = ConnStatusHandler
|
||||||
.getStatusText( m_activity, m_connTypes, addrs[0] );
|
.getStatusText( m_activity, m_connTypes, addr );
|
||||||
|
|
||||||
post( new Runnable() {
|
post( new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -553,10 +553,14 @@ public class ConnStatusHandler {
|
||||||
result = WiDirService.formatNetStateInfo();
|
result = WiDirService.formatNetStateInfo();
|
||||||
break;
|
break;
|
||||||
case COMMS_CONN_BT:
|
case COMMS_CONN_BT:
|
||||||
|
if ( null != addr ) {
|
||||||
result = addr.bt_hostName;
|
result = addr.bt_hostName;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case COMMS_CONN_SMS:
|
case COMMS_CONN_SMS:
|
||||||
|
if ( null != addr ) {
|
||||||
result = addr.sms_phone;
|
result = addr.sms_phone;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue