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>
|
/// <param name="type">The type reference.</param>
|
||||||
private bool ShouldValidate(TypeReference type)
|
private bool ShouldValidate(TypeReference type)
|
||||||
{
|
{
|
||||||
|
if (type == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Extract scope name from type string representation for compatibility
|
// Extract scope name from type string representation for compatibility
|
||||||
// Under Linux, type.Scope.Name sometimes reports incorrectly
|
// Under Linux, type.Scope.Name sometimes reports incorrectly
|
||||||
string scopeName = type.ToString();
|
string scopeName = type.ToString();
|
||||||
|
@ -118,7 +121,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Finders
|
||||||
|
|
||||||
scopeName = scopeName.Substring(0, scopeName.IndexOf(".", System.StringComparison.CurrentCulture));
|
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>
|
/// <summary>Get a unique string representation of a type.</summary>
|
||||||
|
|
Loading…
Reference in New Issue