From 07f401c2e1077987e3e6f77e689d746d28a01892 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 30 Mar 2021 09:23:38 +0200 Subject: [PATCH] Simplify SubCommand.invoke with catch clause --- SpigotCore_Main/src/de/steamwar/command/SubCommand.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java index 8321196..7838108 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java @@ -94,11 +94,8 @@ class SubCommand { objects[0] = commandSenderFunction.apply(commandSender); method.setAccessible(true); method.invoke(swCommand, objects); - } catch (IllegalAccessException | RuntimeException e) { + } catch (IllegalAccessException | RuntimeException | InvocationTargetException e) { throw new SecurityException(e.getMessage(), e); - } catch (InvocationTargetException e) { - Bukkit.getLogger().log(Level.INFO, e.getMessage(), e); - return false; } return true; }