Fix exception if channel is null
This commit is contained in:
parent
4bf35da867
commit
62fc93c4c9
1 changed files with 6 additions and 1 deletions
|
@ -327,7 +327,12 @@ public final class EntityLib {
|
|||
@ApiStatus.Internal
|
||||
public static void sendPacket(UUID user, PacketWrapper<?> wrapper) {
|
||||
checkInit();
|
||||
packetEvents.getProtocolManager().sendPacket(packetEvents.getProtocolManager().getChannel(user), wrapper);
|
||||
Object channel = packetEvents.getProtocolManager().getChannel(user);
|
||||
if (channel == null) {
|
||||
System.out.println("EntityLib could not send packet to user " + user);
|
||||
return;
|
||||
}
|
||||
packetEvents.getProtocolManager().sendPacket(channel, wrapper);
|
||||
}
|
||||
|
||||
private static void checkInit() {
|
||||
|
|
Loading…
Reference in a new issue