Fix event invokes

This commit is contained in:
KingRainbow44 2023-05-22 03:44:04 -04:00
parent 4c0ce8e20e
commit 1de1f42abc
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -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));
}
/**