More null checking here

This commit is contained in:
Edward Capriolo
2016-04-20 14:31:46 -04:00
parent e91d4af3bf
commit abbb088d76

View File

@ -188,8 +188,12 @@ public abstract class GossipManager extends Thread implements NotificationListen
public void shutdown() { public void shutdown() {
_gossipServiceRunning.set(false); _gossipServiceRunning.set(false);
_gossipThreadExecutor.shutdown(); _gossipThreadExecutor.shutdown();
passiveGossipThread.shutdown(); if (passiveGossipThread != null){
activeGossipThread.shutdown(); passiveGossipThread.shutdown();
}
if (activeGossipThread != null){
activeGossipThread.shutdown();
}
try { try {
boolean result = _gossipThreadExecutor.awaitTermination(1000, TimeUnit.MILLISECONDS); boolean result = _gossipThreadExecutor.awaitTermination(1000, TimeUnit.MILLISECONDS);
if (!result){ if (!result){