Avoid NPE related carsh in NetworkService when trying to add a very high latency to a malfunctioning node.

This commit is contained in:
Severiano Jaramillo 2018-12-15 08:51:01 -06:00
parent 0cba6a9f8d
commit 91a5ecdd7b

View file

@ -710,7 +710,8 @@ public class NetworkService extends Service {
// Remove node from nodeLatencyVerifier, so that it publishes its removal // Remove node from nodeLatencyVerifier, so that it publishes its removal
nodeLatencyVerifier.removeNode(mSelectedNode); nodeLatencyVerifier.removeNode(mSelectedNode);
} else { // Avoid crash #133
} else if (mSelectedNode != null){
// Adding a very high latency value to this node in order to prevent // Adding a very high latency value to this node in order to prevent
// us from getting it again // us from getting it again
mSelectedNode.addLatencyValue(Long.MAX_VALUE); mSelectedNode.addLatencyValue(Long.MAX_VALUE);