Fix chat listener assuming nullable is nonnull

This commit is contained in:
Draycia committed 2020-09-16 19:06:56 -07:00
1 parent 49693b4570
commit 68a1086613
1 file changed
+8
@@ -31,6 +31,14 @@ public class BukkitChatListener implements Listener {
final ChatUser user = this.carbonChat.userService().wrap(event.getPlayer());
ChatChannel channel = user.selectedChannel();
if (channel == null) {
if (this.carbonChat.channelManager().defaultChannel() == null) {
return;
}
channel = this.carbonChat.channelManager().defaultChannel();
}
if (channel.shouldCancelChatEvent()) {
event.setCancelled(true);
}