Skip to content

Commit f204a74

Browse files
committed
fix: crash when try to open context menu without selected changes in Changes page
1 parent 6de92bb commit f204a74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ViewModels/WorkingCopy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ public void CommitWithPush()
405405

406406
public ContextMenu CreateContextMenuForUnstagedChanges()
407407
{
408-
if (_selectedUnstaged.Count == 0)
408+
if (_selectedUnstaged == null || _selectedUnstaged.Count == 0)
409409
return null;
410410

411411
var menu = new ContextMenu();
@@ -691,7 +691,7 @@ public ContextMenu CreateContextMenuForUnstagedChanges()
691691

692692
public ContextMenu CreateContextMenuForStagedChanges()
693693
{
694-
if (_selectedStaged.Count == 0)
694+
if (_selectedStaged == null || _selectedStaged.Count == 0)
695695
return null;
696696

697697
var menu = new ContextMenu();

0 commit comments

Comments
 (0)