From 74d7d779f94d0bf35688f03464a873fdb7ec559c Mon Sep 17 00:00:00 2001 From: Simon Rodriguez Date: Fri, 21 Jun 2019 01:54:53 +0200 Subject: [PATCH] Use same if condition as the rest of the places --- Scripts/Editor/NodeGraphEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Editor/NodeGraphEditor.cs b/Scripts/Editor/NodeGraphEditor.cs index 53efae9..f79779f 100644 --- a/Scripts/Editor/NodeGraphEditor.cs +++ b/Scripts/Editor/NodeGraphEditor.cs @@ -74,7 +74,7 @@ namespace XNodeEditor { public virtual void CreateNode(Type type, Vector2 position) { XNode.Node node = target.AddNode(type); node.position = position; - if (string.IsNullOrEmpty(node.name)) node.name = NodeEditorUtilities.NodeDefaultName(type); + if (node.name == null || node.name.Trim() == "") node.name = NodeEditorUtilities.NodeDefaultName(type); AssetDatabase.AddObjectToAsset(node, target); if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); NodeEditorWindow.RepaintAll();