mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 14:38:49 +00:00
Fix chat listener assuming nullable is nonnull
This commit is contained in:
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());
|
final ChatUser user = this.carbonChat.userService().wrap(event.getPlayer());
|
||||||
ChatChannel channel = user.selectedChannel();
|
ChatChannel channel = user.selectedChannel();
|
||||||
|
|
||||||
|
if (channel == null) {
|
||||||
|
if (this.carbonChat.channelManager().defaultChannel() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
channel = this.carbonChat.channelManager().defaultChannel();
|
||||||
|
}
|
||||||
|
|
||||||
if (channel.shouldCancelChatEvent()) {
|
if (channel.shouldCancelChatEvent()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user