diff --git a/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java b/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java index 709f0a8..520e29b 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java +++ b/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java @@ -143,11 +143,11 @@ public class EventHelper { * @since v1-alpha0 */ public static void invokeAnnotatedMethods(@NotNull Class event, Object... arguments) { - Runnable eventCode = () -> { - LoggerInstance logger = new LoggerInstance(new LogIssuer(EventHelper.class, event.getName(), CodePart.ENGINE)); - if (event != LogEvent.class) - logCall(event); + LoggerInstance logger = new LoggerInstance(new LogIssuer(EventHelper.class, event.getName(), CodePart.ENGINE)); + if (event != LogEvent.class) + logCall(event); + Runnable eventCode = () -> { for (ReflectionMethod method : getAnnotatedMethods(event)) { try { method.invoke(arguments);