Preventing a NullPointerException by checking the nodeLatencyVerifier reference first
This commit is contained in:
parent
b37bb9dce0
commit
5ef4ebfca7
1 changed files with 6 additions and 3 deletions
|
@ -331,6 +331,7 @@ public class NetworkService extends Service {
|
||||||
mSelectedNode.setConnected(true);
|
mSelectedNode.setConnected(true);
|
||||||
|
|
||||||
// Updating the selected node's 'connected' status on the NodeLatencyVerifier instance
|
// Updating the selected node's 'connected' status on the NodeLatencyVerifier instance
|
||||||
|
if(nodeLatencyVerifier != null)
|
||||||
nodeLatencyVerifier.updateActiveNodeInformation(mSelectedNode);
|
nodeLatencyVerifier.updateActiveNodeInformation(mSelectedNode);
|
||||||
|
|
||||||
// Notifying all listeners about the new connection status
|
// Notifying all listeners about the new connection status
|
||||||
|
@ -568,6 +569,7 @@ public class NetworkService extends Service {
|
||||||
mSelectedNode.setConnected(false);
|
mSelectedNode.setConnected(false);
|
||||||
|
|
||||||
// Updating the selected node's 'connected' status on the NodeLatencyVerifier instance
|
// Updating the selected node's 'connected' status on the NodeLatencyVerifier instance
|
||||||
|
if(nodeLatencyVerifier != null)
|
||||||
nodeLatencyVerifier.updateActiveNodeInformation(mSelectedNode);
|
nodeLatencyVerifier.updateActiveNodeInformation(mSelectedNode);
|
||||||
|
|
||||||
|
|
||||||
|
@ -612,6 +614,7 @@ public class NetworkService extends Service {
|
||||||
mSelectedNode.setConnected(false);
|
mSelectedNode.setConnected(false);
|
||||||
|
|
||||||
// Updating the selected node's 'connected' status on the NodeLatencyVerifier instance
|
// Updating the selected node's 'connected' status on the NodeLatencyVerifier instance
|
||||||
|
if(nodeLatencyVerifier != null)
|
||||||
nodeLatencyVerifier.updateActiveNodeInformation(mSelectedNode);
|
nodeLatencyVerifier.updateActiveNodeInformation(mSelectedNode);
|
||||||
|
|
||||||
// We have currently no selected node
|
// We have currently no selected node
|
||||||
|
|
Loading…
Reference in a new issue