mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-05 16:08:46 +01:00
Put a null check into IslandCache to avoid null key in map.
This commit is contained in:
parent
c7e0492612
commit
a9a9a9adee
@ -273,7 +273,9 @@ public class IslandCache {
|
||||
*/
|
||||
public void setOwner(@NonNull Island island, @Nullable UUID newOwnerUUID) {
|
||||
island.setOwner(newOwnerUUID);
|
||||
islandsByUUID.computeIfAbsent(Util.getWorld(island.getWorld()), k -> new HashMap<>()).put(newOwnerUUID, island);
|
||||
if (newOwnerUUID != null) {
|
||||
islandsByUUID.computeIfAbsent(Util.getWorld(island.getWorld()), k -> new HashMap<>()).put(newOwnerUUID, island);
|
||||
}
|
||||
islandsByLocation.put(island.getCenter(), island);
|
||||
islandsById.put(island.getUniqueId(), island);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user