mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-23 07:27:22 +01:00
avoid NPE by dropping message after test
This commit is contained in:
parent
5ccb9bf7a3
commit
874b479a69
1 changed files with 11 additions and 7 deletions
|
@ -1231,14 +1231,18 @@ public class BTService extends XWService {
|
||||||
public int sendViaBluetooth( byte[] buf, int gameID, CommsAddrRec addr )
|
public int sendViaBluetooth( byte[] buf, int gameID, CommsAddrRec addr )
|
||||||
{
|
{
|
||||||
int nSent = -1;
|
int nSent = -1;
|
||||||
String btAddr = getSafeAddr( addr );
|
if ( null == m_sender ) {
|
||||||
if ( null != btAddr && 0 < btAddr.length() ) {
|
DbgUtils.logf( "sendViaBluetooth(): no send thread" );
|
||||||
m_sender.add( new BTQueueElem( BTCmd.MESG_SEND, buf, btAddr,
|
|
||||||
gameID ) );
|
|
||||||
nSent = buf.length;
|
|
||||||
} else {
|
} else {
|
||||||
DbgUtils.logf( "sendViaBluetooth(): no addr for dev %s",
|
String btAddr = getSafeAddr( addr );
|
||||||
addr.bt_hostName );
|
if ( null != btAddr && 0 < btAddr.length() ) {
|
||||||
|
m_sender.add( new BTQueueElem( BTCmd.MESG_SEND, buf, btAddr,
|
||||||
|
gameID ) );
|
||||||
|
nSent = buf.length;
|
||||||
|
} else {
|
||||||
|
DbgUtils.logf( "sendViaBluetooth(): no addr for dev %s",
|
||||||
|
addr.bt_hostName );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nSent;
|
return nSent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue