Commit f961503d authored by dbh's avatar dbh Committed by daryl herzmann

OF-1467, Check nodeRoutes.containsKeys(key) to avoid NPE (#999)

* OF-1467, Check nodeRoutes.containsKeys(key) to avoid Null Pointer Exception in ClusterListener, nodeCleanup, when there are no sessions on the node to cleanup

* Good point. Tweak to fix as per suggestion.
parent c65700de
......@@ -280,13 +280,14 @@ public class ClusterListener implements MembershipListener, LifecycleListener {
// Remove outgoing server sessions hosted in node that left the cluster
Set<DomainPair> remoteServers = nodeRoutes.get(key);
if (!remoteServers.isEmpty()) {
if (remoteServers!=null) {
for (DomainPair domainPair : remoteServers) {
routingTable.removeServerRoute(domainPair);
}
}
nodeRoutes.remove(key);
Set<String> components = lookupJIDList(key, componentsCache.getName());
if (!components.isEmpty()) {
for (String address : new ArrayList<String>(components)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment