mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
fix<CommitDetail>: crash when request context menu without any change selected
This commit is contained in:
parent
60e664ab26
commit
8ca74d3a9e
1 changed files with 5 additions and 0 deletions
|
@ -19,6 +19,11 @@ namespace SourceGit.Views {
|
||||||
private void OnChangeListContextRequested(object sender, ContextRequestedEventArgs e) {
|
private void OnChangeListContextRequested(object sender, ContextRequestedEventArgs e) {
|
||||||
if (DataContext is ViewModels.CommitDetail detail) {
|
if (DataContext is ViewModels.CommitDetail detail) {
|
||||||
var datagrid = sender as DataGrid;
|
var datagrid = sender as DataGrid;
|
||||||
|
if (datagrid.SelectedItem == null) {
|
||||||
|
e.Handled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var menu = detail.CreateChangeContextMenu(datagrid.SelectedItem as Models.Change);
|
var menu = detail.CreateChangeContextMenu(datagrid.SelectedItem as Models.Change);
|
||||||
menu.Open(datagrid);
|
menu.Open(datagrid);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue