mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-24 01:43:44 -08:00
fix: avoid NRE in ContextMenuExtension (#526)
This commit is contained in:
parent
18e0479288
commit
c7332aff03
1 changed files with 1 additions and 2 deletions
|
@ -1,5 +1,4 @@
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
|
||||||
namespace SourceGit.Views
|
namespace SourceGit.Views
|
||||||
|
@ -15,7 +14,7 @@ namespace SourceGit.Views
|
||||||
menu.Closing += OnContextMenuClosing; // Clear context menu because it is dynamic.
|
menu.Closing += OnContextMenuClosing; // Clear context menu because it is dynamic.
|
||||||
|
|
||||||
control.ContextMenu = menu;
|
control.ContextMenu = menu;
|
||||||
control.ContextMenu.Open();
|
control.ContextMenu?.Open();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void OnContextMenuClosing(object sender, CancelEventArgs e)
|
private static void OnContextMenuClosing(object sender, CancelEventArgs e)
|
||||||
|
|
Loading…
Add table
Reference in a new issue