From 77f7d55f5af42a3e612b3c87537cdfc1a54e128f Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 17 Aug 2023 15:26:50 +0200 Subject: [PATCH] Fix log spam from `TypeEditor` if type is missing --- Source/Editor/CustomEditors/Editors/TypeEditor.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/Editor/CustomEditors/Editors/TypeEditor.cs b/Source/Editor/CustomEditors/Editors/TypeEditor.cs index 03df18c08..38800a738 100644 --- a/Source/Editor/CustomEditors/Editors/TypeEditor.cs +++ b/Source/Editor/CustomEditors/Editors/TypeEditor.cs @@ -492,9 +492,15 @@ namespace FlaxEditor.CustomEditors.Editors if (!HasDifferentValues && Values[0] is string asTypename && !string.Equals(asTypename, _lastTypeNameError, StringComparison.Ordinal)) { - _element.CustomControl.Value = TypeUtils.GetType(asTypename); - if (_element.CustomControl.Value == null && asTypename.Length != 0) - _lastTypeNameError = asTypename; + try + { + _element.CustomControl.Value = TypeUtils.GetType(asTypename); + } + finally + { + if (_element.CustomControl.Value == null && asTypename.Length != 0) + _lastTypeNameError = asTypename; + } } } }