Skip to content

Commit

Permalink
Fixed ArgumentNullException crash on Devices.ReloadSelectedDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
KimihikoAkayasaki committed Feb 21, 2023
1 parent 271c0cb commit c30e87c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Amethyst/Classes/Shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ public static async Task ReloadSelectedDevice(bool manual, bool reconnect = fals
// Update GeneralPage status
TrackingDevices.UpdateTrackingDevicesInterface();

// Overwrite the selected device if still null for some reason
AppData.Settings.SelectedTrackingDeviceGuid ??= AppData.Settings.TrackingDeviceGuid;
AppData.Settings.PreviousSelectedTrackingDeviceGuid ??= AppData.Settings.TrackingDeviceGuid;

// Refresh the device MVVM
TrackingDevices.TrackingDevicesList[AppData.Settings.SelectedTrackingDeviceGuid].OnPropertyChanged();

Expand Down

0 comments on commit c30e87c

Please sign in to comment.