From bd192d60ed646f25f5ef464f6a912c7283d988f9 Mon Sep 17 00:00:00 2001 From: Dan Erhardt <51964473+DanErhardt@users.noreply.github.com> Date: Mon, 20 Apr 2020 11:06:56 -0300 Subject: [PATCH] A fix for the ArgumentException error. This is the fix proposed by nostravaganza on discord. It works 100%. Could not reproduce the error again. --- Scripts/Editor/NodeEditorUtilities.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Scripts/Editor/NodeEditorUtilities.cs b/Scripts/Editor/NodeEditorUtilities.cs index 9973145..ac12e33 100644 --- a/Scripts/Editor/NodeEditorUtilities.cs +++ b/Scripts/Editor/NodeEditorUtilities.cs @@ -74,8 +74,10 @@ namespace XNodeEditor { Attribute attr; if (!typeTypes.TryGetValue(typeof(T), out attr)) { - if (GetAttrib(classType, fieldName, out attribOut)) typeTypes.Add(typeof(T), attribOut); - else typeTypes.Add(typeof(T), null); + if (GetAttrib(classType, fieldName, out attribOut)) { + typeTypes.Add(typeof(T), attribOut); + return true; + } else typeTypes.Add(typeof(T), null); } if (attr == null) { @@ -261,4 +263,4 @@ namespace XNodeEditor { } } } -} \ No newline at end of file +}