mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 13:51:53 +08:00
fix: crash when try to open context menu without selected changes in Changes page
This commit is contained in:
@@ -405,7 +405,7 @@ namespace SourceGit.ViewModels
|
||||
|
||||
public ContextMenu CreateContextMenuForUnstagedChanges()
|
||||
{
|
||||
if (_selectedUnstaged.Count == 0)
|
||||
if (_selectedUnstaged == null || _selectedUnstaged.Count == 0)
|
||||
return null;
|
||||
|
||||
var menu = new ContextMenu();
|
||||
@@ -691,7 +691,7 @@ namespace SourceGit.ViewModels
|
||||
|
||||
public ContextMenu CreateContextMenuForStagedChanges()
|
||||
{
|
||||
if (_selectedStaged.Count == 0)
|
||||
if (_selectedStaged == null || _selectedStaged.Count == 0)
|
||||
return null;
|
||||
|
||||
var menu = new ContextMenu();
|
||||
|
||||
Reference in New Issue
Block a user