Skip to content

Commit

Permalink
Merge pull request #2447 from BentoBoxWorld/2446_new_player_cannot_lo…
Browse files Browse the repository at this point in the history
…ad_console_error

Fix for #2446 that showed console error when player joined.
  • Loading branch information
tastybento authored Jul 27, 2024
2 parents 11540c0 + 05eef0f commit ad10205
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ private Players addPlayer(@NonNull UUID playerUUID) {
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);
Expand Down

0 comments on commit ad10205

Please sign in to comment.