Skip to content

Commit 8cf17eb

Browse files
authored
Code Quality: Changed the count check condition in HotKey.cs to avoid IndexOutOfRangeException (#17373)
1 parent ff566bb commit 8cf17eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Files.App/Data/Commands/HotKey/HotKey.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public static HotKey Parse(string code, bool localized = true)
308308
{
309309
parts = [code];
310310
}
311-
else if (parts.Count > 0 && string.IsNullOrEmpty(parts.Last()))
311+
else if (parts.Count > 1 && string.IsNullOrEmpty(parts.Last()))
312312
{
313313
// If the last part is empty, remove it and add a "+" to the last non-empty part
314314
parts.RemoveAt(parts.Count - 1);

0 commit comments

Comments
 (0)