Skip to content

Commit 9e2a707

Browse files
authored
Fix: Fixed ArgumentOutOfRangeException in DirectoryPropertiesViewModel (#12717)
1 parent ee5213e commit 9e2a707

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Files.App/Data/Models/DirectoryPropertiesViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public int SelectedBranchIndex
3838
{
3939
if (SetProperty(ref _SelectedBranchIndex, value) &&
4040
value != -1 &&
41-
(value != ACTIVE_BRANCH_INDEX || !_ShowLocals))
41+
(value != ACTIVE_BRANCH_INDEX || !_ShowLocals) &&
42+
value < BranchesNames.Count)
4243
{
4344
CheckoutRequested?.Invoke(this, BranchesNames[value]);
4445
}

0 commit comments

Comments
 (0)