From bdd09a3d0e6428a750aba16873c2f4b9213afe99 Mon Sep 17 00:00:00 2001 From: ShadowCrafter011 Date: Mon, 13 Dec 2021 21:16:14 +0100 Subject: [PATCH] Fixed EventException: null --- .../easyshop/listeners/HandleInventoryClickEvent.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EasyShop/src/org/shadowcrafter/easyshop/listeners/HandleInventoryClickEvent.java b/EasyShop/src/org/shadowcrafter/easyshop/listeners/HandleInventoryClickEvent.java index ebf0375..9939402 100644 --- a/EasyShop/src/org/shadowcrafter/easyshop/listeners/HandleInventoryClickEvent.java +++ b/EasyShop/src/org/shadowcrafter/easyshop/listeners/HandleInventoryClickEvent.java @@ -85,7 +85,9 @@ public void onInventoryClick(InventoryClickEvent e) { int num = -1; String number = e.getCurrentItem().getItemMeta().getDisplayName().replace("§2Buy option ", ""); - num = Integer.parseInt(number) - 1; + try { + num = Integer.parseInt(number) - 1; + }catch (Exception x) {return;}; if (num == -1) { p.sendMessage(Err.SOMETHING_WENT_WRONG);