From b6f3ecc143b3a76240775fe75c9b7b643433bbe5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 4 Aug 2021 18:05:05 -0400 Subject: fix error when error-handling invalid ReflectionTypeLoadException errors --- src/SMAPI.Internal/ExceptionExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/SMAPI.Internal') diff --git a/src/SMAPI.Internal/ExceptionExtensions.cs b/src/SMAPI.Internal/ExceptionExtensions.cs index d7a2252b..5f1ee1fa 100644 --- a/src/SMAPI.Internal/ExceptionExtensions.cs +++ b/src/SMAPI.Internal/ExceptionExtensions.cs @@ -19,9 +19,9 @@ namespace StardewModdingAPI.Internal return $"Failed loading type '{ex.TypeName}': {exception}"; case ReflectionTypeLoadException ex: - string summary = exception.ToString(); - foreach (Exception childEx in ex.LoaderExceptions) - summary += $"\n\n{childEx.GetLogSummary()}"; + string summary = ex.ToString(); + foreach (Exception childEx in ex.LoaderExceptions ?? new Exception[0]) + summary += $"\n\n{childEx?.GetLogSummary()}"; return summary; default: -- cgit