From 05eef0f8ef4177ebea6bcde029b43fdcce6c12c4 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 27 Jul 2024 13:18:15 -0700 Subject: [PATCH] Fix for #2446 that showed console error when player joined. --- .../world/bentobox/bentobox/managers/PlayersManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/managers/PlayersManager.java b/src/main/java/world/bentobox/bentobox/managers/PlayersManager.java index 47c27bea9..dd5dd9bb0 100644 --- a/src/main/java/world/bentobox/bentobox/managers/PlayersManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/PlayersManager.java @@ -84,9 +84,11 @@ public class PlayersManager { Objects.requireNonNull(playerUUID, "Player UUID must not be null"); // If the player exists in the database, load it; otherwise, create and save a new player - Players player = loadPlayer(playerUUID); - if (player != null) { - return player; + if (handler.objectExists(playerUUID.toString())) { + Players p = loadPlayer(playerUUID); + if (p != null) { + return p; + } } Players newPlayer = new Players(plugin, playerUUID); handler.saveObjectAsync(newPlayer);