diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index bb982491..5612fbbe 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -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();