Fix mcchat crash on config issue

This commit is contained in:
Norbi Peti 2020-11-01 13:54:07 +01:00
parent 491b5e4ee9
commit 28cff3ed43
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56

View file

@ -236,7 +236,8 @@ public class MinecraftChatModule extends Component<DiscordPlugin> {
chconc.set("toggles", chcon.toggles);
chconc.set("brtoggles", chcon.brtoggles.stream().map(TBMCSystemChatEvent.BroadcastTarget::getName).collect(Collectors.toList()));
}
listener.stop(true);
if (listener != null) //Can be null if disabled because of a config error
listener.stop(true);
getPlugin().getManager().unregisterCommand(mcChatCommand);
getPlugin().getManager().unregisterCommand(channelconCommand);
disabling = false;