diff --git a/src/Files.App/Data/Models/DirectoryPropertiesViewModel.cs b/src/Files.App/Data/Models/DirectoryPropertiesViewModel.cs index 1f8aef4ab6a2..1daab4dcecc7 100644 --- a/src/Files.App/Data/Models/DirectoryPropertiesViewModel.cs +++ b/src/Files.App/Data/Models/DirectoryPropertiesViewModel.cs @@ -38,7 +38,8 @@ public int SelectedBranchIndex { if (SetProperty(ref _SelectedBranchIndex, value) && value != -1 && - (value != ACTIVE_BRANCH_INDEX || !_ShowLocals)) + (value != ACTIVE_BRANCH_INDEX || !_ShowLocals) && + value < BranchesNames.Count) { CheckoutRequested?.Invoke(this, BranchesNames[value]); }