1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-02-06 23:34:54 +08:00

Fixed #147 - Adding dynamic port using "+" causes exception

This commit is contained in:
Thor Brigsted 2019-06-08 01:41:58 +02:00
parent 4721edc7ec
commit 0c1ae4881d

View File

@ -329,7 +329,7 @@ namespace XNodeEditor {
}
SerializedProperty itemData = arrayData.GetArrayElementAtIndex(index);
EditorGUI.PropertyField(rect, itemData, true);
} else EditorGUI.LabelField(rect, port.fieldName);
} else EditorGUI.LabelField(rect, port != null ? port.fieldName : "");
if (port != null) {
Vector2 pos = rect.position + (port.IsOutput?new Vector2(rect.width + 6, 0) : new Vector2(-36, 0));
NodeEditorGUILayout.PortField(pos, port);