From 3cb0bb95ab51c6df687f5262984a5fa651b1f619 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Sat, 20 Jul 2019 12:21:00 +0300 Subject: [PATCH] Multiple dynamicPortList IndexOutofRange fix. Fixes: #169 and fixes Siccity/xNode#169 --- Scripts/Editor/NodeEditorGUILayout.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Editor/NodeEditorGUILayout.cs b/Scripts/Editor/NodeEditorGUILayout.cs index cd4d320..7372508 100644 --- a/Scripts/Editor/NodeEditorGUILayout.cs +++ b/Scripts/Editor/NodeEditorGUILayout.cs @@ -293,7 +293,7 @@ namespace XNodeEditor { } } return new { index = -1, port = (XNode.NodePort) null }; - }); + }).Where(x => x.port != null); List dynamicPorts = indexedPorts.OrderBy(x => x.index).Select(x => x.port).ToList(); ReorderableList list = null; @@ -423,7 +423,7 @@ namespace XNodeEditor { } } return new { index = -1, port = (XNode.NodePort) null }; - }); + }).Where(x => x.port != null); dynamicPorts = indexedPorts.OrderBy(x => x.index).Select(x => x.port).ToList(); int index = rl.index; @@ -491,4 +491,4 @@ namespace XNodeEditor { return list; } } -} \ No newline at end of file +}