From a0216746b9909fd3ec14b48e0e18e6e940989fbd Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 12 Dec 2024 11:04:28 -0600 Subject: [PATCH] Add value null check in `UiControlEditor` to fix exception --- Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs b/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs index c3330330d..8be473bcb 100644 --- a/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs @@ -723,10 +723,13 @@ namespace FlaxEditor.CustomEditors.Dedicated } // Refresh anchors - GetAnchorEquality(out bool xEq, out bool yEq, ValuesTypes); - if (xEq != _cachedXEq || yEq != _cachedYEq) + if (Values != null && Values[0] != null) { - RebuildLayout(); + GetAnchorEquality(out bool xEq, out bool yEq, ValuesTypes); + if (xEq != _cachedXEq || yEq != _cachedYEq) + { + RebuildLayout(); + } } base.Refresh();