Skip to content

Commit

Permalink
Add catch for null chat packet, for #2129
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 24, 2020
1 parent 18fb805 commit 9089ff1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public boolean sendPacket(final Player player, final PacketOutChat chat) {
if (ExecuteCommand.silencedPlayers.contains(player.getUniqueId())) {
return true;
}
if (chat.getMessage() == null) {
return false;
}
final PlayerReceivesMessageScriptEvent event = PlayerReceivesMessageScriptEvent.instance;
if (event.loaded) {
Callable<Boolean> eventCall = new Callable<Boolean>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ public PacketOutChatImpl(PacketPlayOutChat internal) {
rawJson = IChatBaseComponent.ChatSerializer.a(baseComponent);
}
else {
message = BaseComponent.toPlainText(internal.components);
rawJson = ComponentSerializer.toString(internal.components);
if (internal.components != null) {
message = BaseComponent.toPlainText(internal.components);
rawJson = ComponentSerializer.toString(internal.components);
}
bungee = true;
}
position = (ChatMessageType) POSITION.get(internal);
Expand Down

0 comments on commit 9089ff1

Please sign in to comment.