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:
parent
421fb5747e
commit
aeaaf18099
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user