mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +08:00
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.
This commit is contained in:
parent
1ef3896893
commit
11b7f4ac44
@ -97,7 +97,7 @@ namespace XNodeEditor {
|
|||||||
/// <summary> Make sure the graph editor is assigned and to the right object </summary>
|
/// <summary> Make sure the graph editor is assigned and to the right object </summary>
|
||||||
private void ValidateGraphEditor() {
|
private void ValidateGraphEditor() {
|
||||||
NodeGraphEditor graphEditor = NodeGraphEditor.GetEditor(graph, this);
|
NodeGraphEditor graphEditor = NodeGraphEditor.GetEditor(graph, this);
|
||||||
if (this.graphEditor != graphEditor) {
|
if (this.graphEditor != graphEditor && graphEditor != null) {
|
||||||
this.graphEditor = graphEditor;
|
this.graphEditor = graphEditor;
|
||||||
graphEditor.OnOpen();
|
graphEditor.OnOpen();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user