diff --git a/src/main/java/me/towdium/jecalculation/gui/guis/GuiCraft.java b/src/main/java/me/towdium/jecalculation/gui/guis/GuiCraft.java index 2b7c34d5..58c0388b 100644 --- a/src/main/java/me/towdium/jecalculation/gui/guis/GuiCraft.java +++ b/src/main/java/me/towdium/jecalculation/gui/guis/GuiCraft.java @@ -271,7 +271,11 @@ private void refreshCrafts() { private long getCurrentAmount() { String s = amount.getText(); - return s.isEmpty() ? 1 : Long.parseLong(amount.getText()); + try { + return s.isEmpty() ? 1 : Long.parseLong(amount.getText()); + } catch (NumberFormatException ignored) { + return 1; + } } private void addLabel(ILabel l) {