From 13333cd820b7503a2cbbf299fe813b47e930a804 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 10 Sep 2019 00:43:56 +0200 Subject: [PATCH] Avoid NRE in DefaultMenuInteractionHandler. The input can arrive after the interaction handler has already been detached. --- 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 b0dfa4185e..98f925cd0c 100644 --- a/src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs +++ b/src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs @@ -377,7 +377,7 @@ namespace Avalonia.Controls.Platform if (mouse?.Type == RawPointerEventType.NonClientLeftButtonDown) { - Menu.Close(); + Menu?.Close(); } }