summaryrefslogtreecommitdiff
path: root/src/SMAPI.Internal
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-08-04 18:05:05 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-08-04 18:05:05 -0400
commitb6f3ecc143b3a76240775fe75c9b7b643433bbe5 (patch)
tree39532e789761904f675660dd813672611cb1298e /src/SMAPI.Internal
parent807dcfec7723156a36524d5f1889b5f3208d97cf (diff)
downloadSMAPI-b6f3ecc143b3a76240775fe75c9b7b643433bbe5.tar.gz
SMAPI-b6f3ecc143b3a76240775fe75c9b7b643433bbe5.tar.bz2
SMAPI-b6f3ecc143b3a76240775fe75c9b7b643433bbe5.zip
fix error when error-handling invalid ReflectionTypeLoadException errors
Diffstat (limited to 'src/SMAPI.Internal')
-rw-r--r--src/SMAPI.Internal/ExceptionExtensions.cs6
1 files changed, 3 insertions, 3 deletions
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: