diff --git a/src/Views/ContextMenuExtension.cs b/src/Views/ContextMenuExtension.cs index 6e6dbf20..2abcf2b9 100644 --- a/src/Views/ContextMenuExtension.cs +++ b/src/Views/ContextMenuExtension.cs @@ -1,5 +1,4 @@ using System.ComponentModel; - using Avalonia.Controls; namespace SourceGit.Views @@ -15,7 +14,7 @@ namespace SourceGit.Views menu.Closing += OnContextMenuClosing; // Clear context menu because it is dynamic. control.ContextMenu = menu; - control.ContextMenu.Open(); + control.ContextMenu?.Open(); } private static void OnContextMenuClosing(object sender, CancelEventArgs e)