From e704b97c77b4b06c6a2bc01d27bb6297f788de9f Mon Sep 17 00:00:00 2001 From: Dan Erhardt <51964473+DanErhardt@users.noreply.github.com> Date: Mon, 20 Apr 2020 11:21:19 -0300 Subject: [PATCH] A fix for an ArgumentException error. (#250) 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 +}