From ba85c011059691c434532289e9c9d46542a865ad Mon Sep 17 00:00:00 2001 From: Takoooooo Date: Mon, 17 Jan 2022 16:09:09 +0200 Subject: [PATCH] fix --- src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs b/src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs index a2bdcd1ea8..18348571bf 100644 --- a/src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs +++ b/src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs @@ -101,7 +101,7 @@ namespace Avalonia.Controls.Platform root.Deactivated -= WindowDeactivated; } - if (_root is TopLevel tl) + if (_root is TopLevel tl && tl.PlatformImpl != null) tl.PlatformImpl.LostFocus -= TopLevelLostPlatformFocus; _inputManagerSubscription?.Dispose();