Fix NullPointer at GUI onClick() (#1064)

This commit is contained in:
Dariasc 2018-03-03 23:39:44 -03:00 committed by Trent Hensler
parent a42d4d1d50
commit 6f55243a80
2 changed files with 8 additions and 2 deletions

View File

@ -114,7 +114,10 @@ public class PermissableActionGUI implements InventoryHolder, PermissionGUI {
public void onClick(int slot, ClickType click) { public void onClick(int slot, ClickType click) {
if (specialSlots.containsKey(slot)) { if (specialSlots.containsKey(slot)) {
if (specialSlots.get(slot) == SpecialItem.BACK) { 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; return;
} }

View File

@ -87,7 +87,10 @@ public class PermissableRelationGUI implements InventoryHolder, PermissionGUI {
return; 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) { private Permissable getPermissable(String name) {