diff --git a/src/settings-ui/Settings.UI.Library/CmdPalProperties.cs b/src/settings-ui/Settings.UI.Library/CmdPalProperties.cs index 406f67c2a4..9102609b6b 100644 --- a/src/settings-ui/Settings.UI.Library/CmdPalProperties.cs +++ b/src/settings-ui/Settings.UI.Library/CmdPalProperties.cs @@ -4,9 +4,7 @@ using System; using System.IO; -using System.IO.Abstractions; using System.Text.Json; -using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Library { @@ -46,17 +44,13 @@ namespace Microsoft.PowerToys.Settings.UI.Library if (doc.RootElement.TryGetProperty(nameof(Hotkey), out JsonElement hotkeyElement)) { Hotkey = JsonSerializer.Deserialize(hotkeyElement.GetRawText()); - - if (Hotkey == null) - { - Hotkey = DefaultHotkeyValue; - } } } catch (Exception) { - Hotkey = DefaultHotkeyValue; } + + Hotkey ??= DefaultHotkeyValue; } } }