From 54ad9a76298c5c29b2227e8dda6f323f22136ef2 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 20 Jan 2025 23:49:17 +0100 Subject: [PATCH] Fix error when connecting nodes in Visject --- Source/Editor/Surface/VisjectSurface.Connecting.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Surface/VisjectSurface.Connecting.cs b/Source/Editor/Surface/VisjectSurface.Connecting.cs index 8a74ef8e6..fbbfa2053 100644 --- a/Source/Editor/Surface/VisjectSurface.Connecting.cs +++ b/Source/Editor/Surface/VisjectSurface.Connecting.cs @@ -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