From 18c374bfa9089a4f89b305ebcadd615d2de6e5f7 Mon Sep 17 00:00:00 2001 From: tastybento Date: Wed, 25 Sep 2019 13:46:34 -0700 Subject: [PATCH] Add null protection for player death requests. --- .../java/world/bentobox/bentobox/managers/PlayersManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/managers/PlayersManager.java b/src/main/java/world/bentobox/bentobox/managers/PlayersManager.java index dccd67957..e0f8123a0 100644 --- a/src/main/java/world/bentobox/bentobox/managers/PlayersManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/PlayersManager.java @@ -368,7 +368,7 @@ public class PlayersManager { */ public int getDeaths(World world, UUID playerUUID) { addPlayer(playerUUID); - return playerCache.get(playerUUID).getDeaths(world); + return playerCache.get(playerUUID) == null ? 0 : playerCache.get(playerUUID).getDeaths(world); } /**