Skip to content

Commit

Permalink
[MWB]Fix crash when trying to read null settings (#27682)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo committed Jul 31, 2023
1 parent 3a03ff0 commit a1f21fd
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/settings-ui/Settings.UI.Library/MouseWithoutBordersSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,25 @@ public bool UpgradeSettingsConfiguration()
{
Version = "1.1";

Properties.ToggleEasyMouseShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyToggleEasyMouse.Value);

Properties.LockMachineShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyLockMachine.Value);

Properties.ReconnectShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyReconnect.Value);

Properties.Switch2AllPCShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeySwitch2AllPC.Value);
if (Properties.HotKeyToggleEasyMouse != null)
{
Properties.ToggleEasyMouseShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyToggleEasyMouse.Value);
}

if (Properties.HotKeyLockMachine != null)
{
Properties.LockMachineShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyLockMachine.Value);
}

if (Properties.HotKeyReconnect != null)
{
Properties.ReconnectShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeyReconnect.Value);
}

if (Properties.HotKeySwitch2AllPC != null)
{
Properties.Switch2AllPCShortcut = ConvertMouseWithoutBordersHotKeyToPowerToys(Properties.HotKeySwitch2AllPC.Value);
}

Properties.HotKeyToggleEasyMouse = null;
Properties.HotKeyLockMachine = null;
Expand Down

0 comments on commit a1f21fd

Please sign in to comment.