[MWB]Fix crash when trying to read null settings (#27682)

This commit is contained in:
Jaime Bernardo 2023-07-31 09:14:11 +01:00 committed by GitHub
parent 3a03ff034f
commit a1f21fd6f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,13 +56,25 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{
Version = "1.1";
Properties.ToggleEasyMouseShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyToggleEasyMouse.Value);
if (Properties.HotKeyToggleEasyMouse != null)
{
Properties.ToggleEasyMouseShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyToggleEasyMouse.Value);
}
Properties.LockMachineShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyLockMachine.Value);
if (Properties.HotKeyLockMachine != null)
{
Properties.LockMachineShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyLockMachine.Value);
}
Properties.ReconnectShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyReconnect.Value);
if (Properties.HotKeyReconnect != null)
{
Properties.ReconnectShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyReconnect.Value);
}
Properties.Switch2AllPCShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeySwitch2AllPC.Value);
if (Properties.HotKeySwitch2AllPC != null)
{
Properties.Switch2AllPCShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeySwitch2AllPC.Value);
}
Properties.HotKeyToggleEasyMouse = null;
Properties.HotKeyLockMachine = null;