From 2589f26751f3b7d2374181949a3ed62c9fe647e1 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 22 Jul 2022 09:36:06 +0200 Subject: [PATCH] Remove unneeded change. --- src/Avalonia.Base/StyledElement.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Avalonia.Base/StyledElement.cs b/src/Avalonia.Base/StyledElement.cs index 57bc8006e7..11df4e23f4 100644 --- a/src/Avalonia.Base/StyledElement.cs +++ b/src/Avalonia.Base/StyledElement.cs @@ -316,13 +316,10 @@ namespace Avalonia throw new InvalidOperationException("BeginInit was not called."); } - if (--_initCount == 0) + if (--_initCount == 0 && _logicalRoot is not null) { - if (_logicalRoot is not null) - { - ApplyStyling(); - InitializeIfNeeded(); - } + ApplyStyling(); + InitializeIfNeeded(); } }