From 6315bd5c610b539975f0fc17f86823e030552f32 Mon Sep 17 00:00:00 2001 From: TheMode Date: Mon, 14 Jun 2021 14:42:10 +0200 Subject: [PATCH] Add try-catch for EventNode condition --- src/main/java/net/minestom/server/event/EventNode.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/event/EventNode.java b/src/main/java/net/minestom/server/event/EventNode.java index 7fec44fd9..c6b359564 100644 --- a/src/main/java/net/minestom/server/event/EventNode.java +++ b/src/main/java/net/minestom/server/event/EventNode.java @@ -215,7 +215,12 @@ public class EventNode { if (predicate == null) return true; final var value = filter.getHandler(event); - return predicate.test(event, value); + try { + return predicate.test(event, value); + } catch (Exception e) { + MinecraftServer.getExceptionManager().handleException(e); + return false; + } } /**