Only disconnect known nodes.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 May 2009 05:01:29 +0000 (07:01 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 May 2009 05:01:29 +0000 (07:01 +0200)
src/net/pterodactylus/jsite/core/NodeManager.java

index 74221d4..e8fd278 100644 (file)
@@ -343,6 +343,10 @@ public class NodeManager implements Iterable<Node>, PropertyChangeListener {
         */
        public void disconnect(Node node) {
                logger.log(Level.FINEST, "disconnect(node=" + node + ")");
+               if (!nodes.contains(node)) {
+                       logger.log(Level.WARNING, "Was told to disconnect from a node (" + node + ") I don’t know about!");
+                       return;
+               }
        }
 
        /**