mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-21 18:25:12 +01:00
Merge pull request #2447 from BentoBoxWorld/2446_new_player_cannot_load_console_error
Fix for #2446 that showed console error when player joined.
This commit is contained in:
commit
ad10205c99
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user