From 63cf1355503bf4742f56dec6b11fcf7f72bbea13 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Mon, 30 May 2022 03:33:28 -0400 Subject: [PATCH] Try Catch --- NewHorizons/Main.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index d4bcc7fc..f4c9ad09 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -158,7 +158,14 @@ namespace NewHorizons private static void OnWakeUp() { IsSystemReady = true; - Instance.OnStarSystemLoaded?.Invoke(Instance.CurrentStarSystem); + try + { + Instance.OnStarSystemLoaded?.Invoke(Instance.CurrentStarSystem); + } + catch (Exception e) + { + Logger.LogError($"Exception thrown when invoking star system loaded event with parameter [{Instance.CurrentStarSystem}] : {e.GetType().FullName} {e.Message} {e.StackTrace}"); + } } private void OnSceneUnloaded(Scene scene)