From 11b7f4ac4444220d7075f9a07e387477f31d0bc7 Mon Sep 17 00:00:00 2001 From: Jeff Campbell Date: Sat, 7 Mar 2020 21:30:46 +0100 Subject: [PATCH] Added NRE check for ValidateGraphEditor * Added NRE check to prevent exception when NodeGraphEditor.GetEditor returns null and an existing non-null graph editor is already present. --- Scripts/Editor/NodeEditorWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Editor/NodeEditorWindow.cs b/Scripts/Editor/NodeEditorWindow.cs index 1f64653..4fc1136 100644 --- a/Scripts/Editor/NodeEditorWindow.cs +++ b/Scripts/Editor/NodeEditorWindow.cs @@ -97,7 +97,7 @@ namespace XNodeEditor { /// Make sure the graph editor is assigned and to the right object private void ValidateGraphEditor() { NodeGraphEditor graphEditor = NodeGraphEditor.GetEditor(graph, this); - if (this.graphEditor != graphEditor) { + if (this.graphEditor != graphEditor && graphEditor != null) { this.graphEditor = graphEditor; graphEditor.OnOpen(); }