fix NPE (and tweak logging)

This commit is contained in:
Eric House 2019-02-03 10:36:54 -08:00
parent fd122148b8
commit 8ff23294e6
2 changed files with 8 additions and 4 deletions

View file

@ -1149,7 +1149,7 @@ public class RelayService extends JobIntentService
gotEOQ = true;
break;
} else if ( skipNativeSend() || outData.getForWeb() ) {
dataListWeb.add (outData );
dataListWeb.add( outData );
} else {
dataListUDP.add( outData );
}
@ -1285,9 +1285,10 @@ public class RelayService extends JobIntentService
ConnStatusHandler.updateStatus( service, null,
CommsConnType.COMMS_CONN_RELAY,
sentLen > 0 );
Log.d( TAG, "sendViaUDP(): sent %d bytes (%d packets)",
sentLen, packets.size() );
}
Log.d( TAG, "sendViaUDP(): sent %d bytes", sentLen );
return sentLen;
}
@ -1326,7 +1327,8 @@ public class RelayService extends JobIntentService
s_packetsSentUDP.size() );
}
if ( foundNonAck ) {
Log.d( TAG, "runUDPAckTimer(): reposting %d packets", forResend.size() );
Log.d( TAG, "runUDPAckTimer(): reposting %d packets",
forResend.size() );
m_queue.addAll( forResend );
}
}

View file

@ -59,7 +59,9 @@ public class DUtilCtxt {
typ = DevIDType.ID_TYPE_RELAY;
} else {
result = FBMService.getFCMDevID( m_context );
if ( result.equals("") ) {
if ( null == result ) {
// do nothing
} else if ( result.equals("") ) {
result = null;
} else {
typ = DevIDType.ID_TYPE_ANDROID_FCM;