From 4d33f6792676bbb33cdbb67201eff37cdd525879 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 25 May 2021 10:13:10 +0200 Subject: [PATCH] Fix BauGUICommand Signed-off-by: yoyosource --- .../de/steamwar/bausystem/features/gui/BauGUICommand.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java index 620b9c09..0086dee2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java @@ -70,8 +70,12 @@ public class BauGUICommand extends SWCommand { @Register("import") public void importGui(Player p, String code) { - if (BauGuiImportExport.importGui(code, p)) { - BauSystem.MESSAGE.send("GUI_IMPORT_CODE-SUCCESSFUL", p); + try { + if (BauGuiImportExport.importGui(code, p)) { + BauSystem.MESSAGE.send("GUI_IMPORT_CODE-SUCCESSFUL", p); + } + } catch (Exception e) { + BauSystem.MESSAGE.send("GUI_IMPORT_INVALID-CODE", p); } } }