From 5e629e7890aead59183289f79b20df7c574b0dd1 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 18 Oct 2023 20:50:47 -0500 Subject: [PATCH] null checks for Building.getFriends() --- src/engine/gameManager/BuildingManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 787917dc..6e591cc4 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -118,7 +118,7 @@ public enum BuildingManager { return true; //individual friend. - if (building.getFriends().get(player.getObjectUUID()) != null) + if (building.getFriends() != null && building.getFriends().get(player.getObjectUUID()) != null) return true; //Admin's can access stuff @@ -132,11 +132,11 @@ public enum BuildingManager { if (building.getGuild() != null && building.getGuild().isGuildLeader(player.getObjectUUID())) return true; - if (building.getFriends().get(player.getGuild().getObjectUUID()) != null + if (building.getFriends() != null && building.getFriends().get(player.getGuild().getObjectUUID()) != null && building.getFriends().get(player.getGuild().getObjectUUID()).friendType == 8) return true; - if (building.getFriends().get(player.getGuild().getObjectUUID()) != null + if (building.getFriends() != null && building.getFriends().get(player.getGuild().getObjectUUID()) != null && building.getFriends().get(player.getGuild().getObjectUUID()).friendType == 9 && GuildStatusController.isInnerCouncil(player.getGuildStatus())) return true;