Skip to content

Commit 30ae1a3

Browse files
Fix: Prevent crash when parsing an empty hotkey string (#17369)
Co-authored-by: seer-by-sentry[bot] <157164994+seer-by-sentry[bot]@users.noreply.github.com>
1 parent 6a75b09 commit 30ae1a3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ public HotKey(Keys key, KeyModifiers modifier = KeyModifiers.None, bool isVisibl
278278
/// <returns>Humanized code with a format <see cref="HotKey"/>.</returns>
279279
public static HotKey Parse(string code, bool localized = true)
280280
{
281+
if (string.IsNullOrEmpty(code))
282+
return None;
283+
281284
var key = Keys.None;
282285
var modifier = KeyModifiers.None;
283286
bool isVisible = true;

0 commit comments

Comments
 (0)