Preventing a NullPointerException while handling a node disconnection
This commit is contained in:
parent
af5896a160
commit
843aacb859
1 changed files with 8 additions and 6 deletions
|
@ -690,19 +690,21 @@ public class NetworkService extends Service {
|
|||
|
||||
isLoggedIn = false;
|
||||
|
||||
if(mSelectedNode != null){
|
||||
// Marking the selected node as not connected
|
||||
mSelectedNode.setConnected(false);
|
||||
|
||||
// Updating the selected node's 'connected' status on the NodeLatencyVerifier instance
|
||||
if(nodeLatencyVerifier != null)
|
||||
nodeLatencyVerifier.updateActiveNodeInformation(mSelectedNode);
|
||||
}
|
||||
|
||||
if(tryReconnection) {
|
||||
// Registering current status
|
||||
mCurrentId = 0;
|
||||
mApiIds.clear();
|
||||
|
||||
if (removeSelectedNode) {
|
||||
if (removeSelectedNode && mSelectedNode != null) {
|
||||
// Remove node from node provider so that it is not returned for following connections
|
||||
nodeProvider.removeNode(mSelectedNode);
|
||||
|
||||
|
|
Loading…
Reference in a new issue