Suppressing all exceptions caused by InventoryCloseEvent

These are caused by bad implementations not related to QuickShop, but
exceptions are annoying.
This commit is contained in:
Kai committed 2017-06-13 00:09:55 +02:00
1 parent dd607b4244
commit 19e4b2b678
1 file changed
+19 -15
@@ -204,21 +204,25 @@ public class PlayerListener implements Listener {
@EventHandler
public void onInventoryClose(InventoryCloseEvent e) {
final Inventory inventory = e.getInventory();
if (inventory == null) {
return;
try {
final Inventory inventory = e.getInventory();
if (inventory == null) {
return;
}
final Location location = inventory.getLocation();
if (location == null) {
return;
}
final Shop shop = plugin.getShopManager().getShop(location);
if (shop == null) {
return;
}
shop.setSignText();
} catch (Throwable t) {
}
final Location location = inventory.getLocation();
if (location == null) {
return;
}
final Shop shop = plugin.getShopManager().getShop(location);
if (shop == null) {
return;
}
shop.setSignText();
}
}