Fix error when connecting nodes in Visject

This commit is contained in:
Wojtek Figat
2025-01-20 23:49:17 +01:00
parent f4c07388d9
commit 011abe4ac0

View File

@@ -60,12 +60,12 @@ namespace FlaxEditor.Surface
if (toIsReference && !fromIsReference)
{
var toTypeName = to.TypeName;
return from.TypeName == toTypeName.Substring(0, toTypeName.Length - 1);
return !string.IsNullOrEmpty(toTypeName) && from.TypeName == toTypeName.Substring(0, toTypeName.Length - 1);
}
if (!toIsReference && fromIsReference)
{
var fromTypeName = from.TypeName;
return to.TypeName == fromTypeName.Substring(0, fromTypeName.Length - 1);
return !string.IsNullOrEmpty(fromTypeName) && to.TypeName == fromTypeName.Substring(0, fromTypeName.Length - 1);
}
// Implicit casting is supported for object reference to test whenever it is valid