From 4bf1905496e6ed72d9346548d14b92e806f56249 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 1 Jan 2021 09:47:18 +0100 Subject: [PATCH] Fix Illegal argument exception Signed-off-by: Lixfel --- .../src/de/steamwar/schematicsystem/commands/GUI.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java index d14f7ea..7523e65 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java @@ -207,8 +207,13 @@ class GUI { Material m; if (schem.getItem().isEmpty()) m = SWItem.getMaterial("CAULDRON_ITEM"); - else - m = SWItem.getMaterial(schem.getItem()); + else{ + try{ + m = SWItem.getMaterial(schem.getItem()); + }catch(IllegalArgumentException e){ + m = SWItem.getMaterial("CAULDRON_ITEM"); + } + } SWItem item = new SWItem(m, "§e" + schem.getSchemName(), Collections.singletonList("§7" + schem.getSchemType().name()), !schem.getSchemType().writeable(), click -> {}); if(schem.getRank() > 0)