diff --git a/Arma.Studio.UiEditor/UI/Adorners/HighlightElementsAdorner.cs b/Arma.Studio.UiEditor/UI/Adorners/HighlightElementsAdorner.cs index b4bb0aa..a5b6d46 100644 --- a/Arma.Studio.UiEditor/UI/Adorners/HighlightElementsAdorner.cs +++ b/Arma.Studio.UiEditor/UI/Adorners/HighlightElementsAdorner.cs @@ -80,6 +80,10 @@ private static void PropertyChangedCallback(DependencyObject sender, DependencyP if (e.NewValue is bool newFlag && newFlag) { var adornerLayer = AdornerLayer.GetAdornerLayer(uiElement); + if (adornerLayer is null) + { + return; + } var affected = new HighlightElementsAdorner(uiElement); adornerLayer.Add(affected); }