From 0f337696c1d04147b5fdb88cda534d429d313a08 Mon Sep 17 00:00:00 2001 From: tueem Date: Fri, 1 Nov 2024 17:36:12 +0100 Subject: [PATCH] change to selective catching --- .../marinara/interaction/methods/InteractionMethod.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/main/java/net/tomatentum/marinara/interaction/methods/InteractionMethod.java b/lib/src/main/java/net/tomatentum/marinara/interaction/methods/InteractionMethod.java index 89e1ff0..b84f755 100644 --- a/lib/src/main/java/net/tomatentum/marinara/interaction/methods/InteractionMethod.java +++ b/lib/src/main/java/net/tomatentum/marinara/interaction/methods/InteractionMethod.java @@ -1,5 +1,6 @@ package net.tomatentum.marinara.interaction.methods; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.security.InvalidParameterException; import java.util.ArrayList; @@ -52,8 +53,8 @@ public abstract class InteractionMethod { } method.setAccessible(true); try { - method.invoke(handler, parameters); - }catch (Exception ex) { + method.invoke(handler, parameters.toArray()); + }catch (IllegalAccessException | InvocationTargetException ex) { throw new RuntimeException(ex); } }