From 6f55243a80ea5dbd1b10b237190c982d5524e3cd Mon Sep 17 00:00:00 2001 From: Dariasc Date: Sat, 3 Mar 2018 23:39:44 -0300 Subject: [PATCH] Fix NullPointer at GUI onClick() (#1064) --- .../factions/zcore/fperms/gui/PermissableActionGUI.java | 5 ++++- .../factions/zcore/fperms/gui/PermissableRelationGUI.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java index a43af63c..efd8f8b1 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java @@ -114,7 +114,10 @@ public class PermissableActionGUI implements InventoryHolder, PermissionGUI { public void onClick(int slot, ClickType click) { if (specialSlots.containsKey(slot)) { if (specialSlots.get(slot) == SpecialItem.BACK) { - fme.getPlayer().openInventory(new PermissableRelationGUI(fme).getInventory()); + PermissableRelationGUI relationGUI = new PermissableRelationGUI(fme); + relationGUI.build(); + + fme.getPlayer().openInventory(relationGUI.getInventory()); } return; } diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java index af71af04..94b7dadc 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java @@ -87,7 +87,10 @@ public class PermissableRelationGUI implements InventoryHolder, PermissionGUI { return; } - fme.getPlayer().openInventory(new PermissableActionGUI(fme, relationSlots.get(slot)).getInventory()); + PermissableActionGUI actionGUI = new PermissableActionGUI(fme, relationSlots.get(slot)); + actionGUI.build(); + + fme.getPlayer().openInventory(actionGUI.getInventory()); } private Permissable getPermissable(String name) {