Try Catch

This commit is contained in:
Noah Pilarski 2022-05-30 03:33:28 -04:00
parent 977c790ef5
commit ec0d500ef1

View File

@ -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)