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

@ -1285,9 +1285,10 @@ public class RelayService extends JobIntentService
ConnStatusHandler.updateStatus( service, null, ConnStatusHandler.updateStatus( service, null,
CommsConnType.COMMS_CONN_RELAY, CommsConnType.COMMS_CONN_RELAY,
sentLen > 0 ); sentLen > 0 );
Log.d( TAG, "sendViaUDP(): sent %d bytes (%d packets)",
sentLen, packets.size() );
} }
Log.d( TAG, "sendViaUDP(): sent %d bytes", sentLen );
return sentLen; return sentLen;
} }
@ -1326,7 +1327,8 @@ public class RelayService extends JobIntentService
s_packetsSentUDP.size() ); s_packetsSentUDP.size() );
} }
if ( foundNonAck ) { if ( foundNonAck ) {
Log.d( TAG, "runUDPAckTimer(): reposting %d packets", forResend.size() ); Log.d( TAG, "runUDPAckTimer(): reposting %d packets",
forResend.size() );
m_queue.addAll( forResend ); m_queue.addAll( forResend );
} }
} }

View file

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