GetType null check

This commit is contained in:
mackysoft 2023-08-19 21:27:58 +09:00
parent 396e4a2c30
commit 80b67bce51

View File

@ -13,6 +13,11 @@ namespace MackySoft.SerializeReferenceExtensions.Editor {
}
public static Type GetType (string typeName) {
if (string.IsNullOrEmpty(typeName))
{
return null;
}
int splitIndex = typeName.IndexOf(' ');
var assembly = Assembly.Load(typeName.Substring(0,splitIndex));
return assembly.GetType(typeName.Substring(splitIndex + 1));