Fixed PacketChat NPE

This commit is contained in:
Auxilor 2020-12-03 08:58:06 +00:00
parent b223c9cebc
commit 07ceeb4fdb

View File

@ -16,6 +16,8 @@ public class PacketChat extends AbstractPacketAdapter {
public void onSend(PacketContainer packet) {
for(int i = 0; i < packet.getChatComponents().size(); i++) {
WrappedChatComponent component = packet.getChatComponents().read(i);
if(component == null || component.getHandle() == null)
continue;
WrappedChatComponent newComponent = WrappedChatComponent.fromHandle(ChatComponent.modifyComponent(component.getHandle()));
packet.getChatComponents().write(i, newComponent);
}