X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fxdcc%2Fcore%2FCore.java;h=68628d70bbce5d0f39912558eb8a0b0b7e501d74;hb=f5fcfe1bbd91b46e873a870a0548349002a0c626;hp=5bcccf319ed8d101eae85b66a05ba2a0daca4974;hpb=b6c081057ba5fd76c5eed0ce76675a3170d80830;p=xudocci.git diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 5bcccf3..68628d7 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -557,12 +557,16 @@ public class Core extends AbstractExecutionThreadService { return; } + Optional channel = getChannel(network.get(), channelNotJoined.channel()); + if (!channel.isPresent()) { + eventBus.post(new GenericMessage(format("Could not join %s but didn’t try to join, either.", channel.get()))); + return; + } + 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) {