From ba6938063801bf4b406500681383aa7942485c3d Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Mon, 29 Oct 2018 21:20:22 +0100 Subject: [PATCH] Fixed error on instanceportlists that aren't arrays --- Scripts/Editor/NodeEditorGUILayout.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Scripts/Editor/NodeEditorGUILayout.cs b/Scripts/Editor/NodeEditorGUILayout.cs index df8d9189..7ee43a61 100644 --- a/Scripts/Editor/NodeEditorGUILayout.cs +++ b/Scripts/Editor/NodeEditorGUILayout.cs @@ -285,10 +285,13 @@ private static ReorderableList CreateReorderableList(List instan Vector2 pos = rect.position + (port.IsOutput?new Vector2(rect.width + 6, 0) : new Vector2(-36, 0)); NodeEditorGUILayout.PortField(pos, port); }; - list.elementHeightCallback = (int index) => { - SerializedProperty itemData = arrayData.GetArrayElementAtIndex(index); - return EditorGUI.GetPropertyHeight(itemData); - }; + list.elementHeightCallback = + (int index) => { + if (hasArrayData) { + SerializedProperty itemData = arrayData.GetArrayElementAtIndex(index); + return EditorGUI.GetPropertyHeight(itemData); + } else return EditorGUIUtility.singleLineHeight; + }; list.drawHeaderCallback = (Rect rect) => { EditorGUI.LabelField(rect, label);