Fix type==null case
This commit is contained in:
parent
2b2860637d
commit
829e24b23e
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue