From 10d1709c6f0aa25690cc129dc92f82c9f4399525 Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 16 Sep 2024 20:41:06 -0700 Subject: [PATCH] Skip null worlds that have not been loaded but in database. --- src/main/java/world/bentobox/level/LevelsManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/level/LevelsManager.java b/src/main/java/world/bentobox/level/LevelsManager.java index 39316f6..448757a 100644 --- a/src/main/java/world/bentobox/level/LevelsManager.java +++ b/src/main/java/world/bentobox/level/LevelsManager.java @@ -107,7 +107,8 @@ public void migrate() { * @return true if successful, false if not added */ private boolean addToTopTen(Island island, long lv) { - if (island != null && island.getOwner() != null && hasTopTenPerm(island.getWorld(), island.getOwner())) { + if (island != null && island.getOwner() != null && island.getWorld() != null + && hasTopTenPerm(island.getWorld(), island.getOwner())) { topTenLists.computeIfAbsent(island.getWorld(), k -> new TopTenData(island.getWorld())).getTopTen() .put(island.getUniqueId(), lv); return true;