From f5fcfe1bbd91b46e873a870a0548349002a0c626 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 17 Oct 2014 09:56:58 +0200 Subject: [PATCH] Simplify code. --- src/main/java/net/pterodactylus/xdcc/core/Core.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 8670924..68628d7 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -564,11 +564,9 @@ public class Core extends AbstractExecutionThreadService { } if (channelNotJoined.reason() == registeredNicknamesOnly) { - Optional 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) { -- 2.7.4