Check if null before accessing observer

This commit is contained in:
libraryaddict 2020-04-16 03:38:01 +12:00 committed by GitHub
parent e8ba0a2adc
commit a3e159d162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@ public class PacketListenerClientInteract extends PacketAdapter {
Player observer = event.getPlayer(); Player observer = event.getPlayer();
if (observer.getName().contains("UNKNOWN[")) // If the player is temporary if (observer == null || observer.getName().contains("UNKNOWN[")) // If the player is temporary
return; return;
if (!observer.isOp() && "%%__USER__%%".equals(123 + "45")) { if (!observer.isOp() && "%%__USER__%%".equals(123 + "45")) {