From 1de1f42abcb3e5910d7b456d76e44927f5fbc7aa Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Mon, 22 May 2023 03:44:04 -0400 Subject: [PATCH] Fix event invokes --- src/main/java/emu/grasscutter/plugin/PluginManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/plugin/PluginManager.java b/src/main/java/emu/grasscutter/plugin/PluginManager.java index 60684d15d..fcab1778d 100644 --- a/src/main/java/emu/grasscutter/plugin/PluginManager.java +++ b/src/main/java/emu/grasscutter/plugin/PluginManager.java @@ -295,8 +295,10 @@ public final class PluginManager { * @param event The event to invoke. */ public void invokeEvent(Event event) { - this.handlers.get(event.getClass()) - .forEach(handler -> this.invokeHandler(event, handler)); + var handlers = this.handlers.get(event.getClass()); + if (handlers == null) return; + + handlers.forEach(handler -> this.invokeHandler(event, handler)); } /**