diff options
author | E. Behar <ebehar@users.noreply.github.com> | 2018-07-06 23:21:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 23:21:13 -0700 |
commit | 829e24b23e23ed44392c07d266107bf4a2f36998 (patch) | |
tree | 18c897046ba959c697c39963fd931c5e20fa6813 | |
parent | 2b2860637d36b17d51ce279afaa4d81cefef289d (diff) | |
download | SMAPI-829e24b23e23ed44392c07d266107bf4a2f36998.tar.gz SMAPI-829e24b23e23ed44392c07d266107bf4a2f36998.tar.bz2 SMAPI-829e24b23e23ed44392c07d266107bf4a2f36998.zip |
Fix type==null case
-rw-r--r-- | src/SMAPI/Framework/ModLoading/Finders/ReferenceToMemberWithUnexpectedTypeFinder.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/ModLoading/Finders/ReferenceToMemberWithUnexpectedTypeFinder.cs b/src/SMAPI/Framework/ModLoading/Finders/ReferenceToMemberWithUnexpectedTypeFinder.cs index 6364cec8..bd5c97d6 100644 --- a/src/SMAPI/Framework/ModLoading/Finders/ReferenceToMemberWithUnexpectedTypeFinder.cs +++ b/src/SMAPI/Framework/ModLoading/Finders/ReferenceToMemberWithUnexpectedTypeFinder.cs @@ -110,6 +110,9 @@ namespace StardewModdingAPI.Framework.ModLoading.Finders /// <param name="type">The type reference.</param> private bool ShouldValidate(TypeReference type) { + if (type == null) + return false; + // Extract scope name from type string representation for compatibility // Under Linux, type.Scope.Name sometimes reports incorrectly string scopeName = type.ToString(); @@ -118,7 +121,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Finders scopeName = scopeName.Substring(0, scopeName.IndexOf(".", System.StringComparison.CurrentCulture)); - return type != null && this.ValidateReferencesToAssemblies.Contains(scopeName); + return this.ValidateReferencesToAssemblies.Contains(scopeName); } /// <summary>Get a unique string representation of a type.</summary> |