1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-02-06 07:14:56 +08:00

Added a null check for NodeEditorWindow.current.

It returns a new instance of the Settings class if the NodeEditorWindow.current is null.
This commit is contained in:
DeepWolf413 2019-10-23 12:01:20 +02:00
parent 421fb5747e
commit aeaaf18099

View File

@ -81,6 +81,8 @@ namespace XNodeEditor {
/// <summary> Get settings of current active editor </summary>
public static Settings GetSettings() {
if (XNodeEditor.NodeEditorWindow.current == null) return new Settings();
if (lastEditor != XNodeEditor.NodeEditorWindow.current.graphEditor) {
object[] attribs = XNodeEditor.NodeEditorWindow.current.graphEditor.GetType().GetCustomAttributes(typeof(XNodeEditor.NodeGraphEditor.CustomNodeGraphEditorAttribute), true);
if (attribs.Length == 1) {