diff --git a/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java b/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java index 7676de2..1d40716 100644 --- a/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java +++ b/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java @@ -157,6 +157,11 @@ public class SchematicSelector { } private SchematicNode dirUp(SchematicNode parent) { + if(parent == null) { + // Gracefully handle unexpected Updir in Root Folder + depth = 0; + return null; + } if(!singleDirOpen) { if(NodeMember.getNodeMember(parent.getId(), user.getId()) != null) { return null; @@ -239,7 +244,7 @@ public class SchematicSelector { SWItem item = new SWItem(m, name, Collections.singletonList(node.isDir() ? (Core.MESSAGE.parse("SCHEM_SELECTOR_DIR", player)) : Core.MESSAGE.parse("SCHEM_SELECTOR_ITEM_LORE_TYPE", player, node.getSchemtype().name())), !node.isDir() && !node.getSchemtype().writeable(), click -> { }); if(!node.isDir() && node.getRank() > 0) { - item.setLore(Arrays.asList(Core.MESSAGE.parse("SCHEM_SELECTOR_ITEM_LORE_TYPE", player, node.getSchemtype().name()), Core.MESSAGE.parse("SCHEM_SELECTOR_RANK", player))); + item.setLore(Arrays.asList(Core.MESSAGE.parse("SCHEM_SELECTOR_ITEM_LORE_TYPE", player, node.getSchemtype().name()), Core.MESSAGE.parse("SCHEM_SELECTOR_RANK", player, node.getRank()))); } return new SWListInv.SWListEntry<>(item, node); } diff --git a/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java b/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java index e6fa356..5331270 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java @@ -287,8 +287,6 @@ public class SchematicNode { @Deprecated public String getType() { - if(isDir) - throw new SecurityException("Node is Directory"); return type; }