Simplify code.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 Oct 2014 07:56:58 +0000 (09:56 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 Oct 2014 07:56:58 +0000 (09:56 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index 8670924..68628d7 100644 (file)
@@ -564,11 +564,9 @@ public class Core extends AbstractExecutionThreadService {
                }
 
                if (channelNotJoined.reason() == registeredNicknamesOnly) {
-                       Optional<Channel> channel = getChannel(network.get(), channelNotJoined.channel());
-                       if (channel.isPresent()) {
-                               eventBus.post(new GenericMessage(format("Not trying to join %s anymore.", channel.get())));
-                               channels.remove(channel.get());
-                       }
+                       channels.remove(channel.get());
+                       eventBus.post(new GenericMessage(
+                                       format("Not trying to join %s anymore.", channel.get())));
                        return;
                }
                if (channelNotJoined.reason() == banned) {