Remove connection when it’s not established so that it can be retried.
[xudocci.git] / src / main / java / net / pterodactylus / xdcc / core / Core.java
index ded98cf..6da5dbd 100644 (file)
@@ -459,6 +459,7 @@ public class Core extends AbstractExecutionThreadService {
                if (!network.isPresent()) {
                        return;
                }
+               networkConnections.remove(network.get());
                if (!connection.established()) {
                        return;
                }
@@ -484,9 +485,6 @@ public class Core extends AbstractExecutionThreadService {
                }
                bots.clear();
                eventBus.post(new GenericMessage(String.format("Network %s disconnected, %d bots removed, %d packs removed.", network.get().name(), botCount, packCount)));
-
-               /* now remove the network. */
-               networkConnections.remove(network.get());
        }
 
        //