From 2535122accf28a1fb3bb007787e4468882c6c479 Mon Sep 17 00:00:00 2001 From: Lucas <29230467+Somfic@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:13:09 +0100 Subject: [PATCH] Do not propagate error when parsing event JSON --- EliteAPI/Events/Events.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EliteAPI/Events/Events.cs b/EliteAPI/Events/Events.cs index e0574b8f..7aa09104 100644 --- a/EliteAPI/Events/Events.cs +++ b/EliteAPI/Events/Events.cs @@ -212,7 +212,7 @@ public IEvent Invoke(TEvent @event, EventContext context) where TEvent : { if (string.IsNullOrEmpty(json)) throw new ArgumentNullException(nameof(json)); - + var jObject = JObject.Parse(json); var eventKey = jObject["event"]; @@ -287,7 +287,7 @@ public IEvent Invoke(TEvent @event, EventContext context) where TEvent : ex.Data.Add("JSON", json); ex.Data.Add("File", context.SourceFile); _log?.LogWarning(ex, "Could not invoke event from JSON"); - throw; + return null; } }