From 319d104622133e757f5c95b22c3844cf09b9d449 Mon Sep 17 00:00:00 2001 From: Intelli Date: Wed, 7 Dec 2022 17:49:50 -0700 Subject: [PATCH] Fixed NullPointerException when killing NPC (#261) --- .../net/coreprotect/database/logger/PlayerKillLogger.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/coreprotect/database/logger/PlayerKillLogger.java b/src/main/java/net/coreprotect/database/logger/PlayerKillLogger.java index aba731a..6807977 100644 --- a/src/main/java/net/coreprotect/database/logger/PlayerKillLogger.java +++ b/src/main/java/net/coreprotect/database/logger/PlayerKillLogger.java @@ -24,6 +24,10 @@ public class PlayerKillLogger { return; } + if (ConfigHandler.playerIdCache.get(player.toLowerCase(Locale.ROOT)) == null) { + UserStatement.loadId(preparedStmt.getConnection(), player, null); + } + CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user); CoreProtect.getInstance().getServer().getPluginManager().callEvent(event);