From 2d0d73b617886dc69977a0f19c28868861545041 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Wed, 23 Oct 2024 14:19:34 -0500 Subject: [PATCH] Null-coalesce autoload dirs on config load --- .../Configuration/ConfigurationState.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs b/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs index 3c3bc458c..fd065be1e 100644 --- a/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs +++ b/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs @@ -1500,7 +1500,7 @@ namespace Ryujinx.UI.Common.Configuration { Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 52."); - configurationFileFormat.AutoloadDirs = new(); + configurationFileFormat.AutoloadDirs = []; configurationFileUpdated = true; } @@ -1585,7 +1585,7 @@ namespace Ryujinx.UI.Common.Configuration UI.ColumnSort.SortColumnId.Value = configurationFileFormat.ColumnSort.SortColumnId; UI.ColumnSort.SortAscending.Value = configurationFileFormat.ColumnSort.SortAscending; UI.GameDirs.Value = configurationFileFormat.GameDirs; - UI.AutoloadDirs.Value = configurationFileFormat.AutoloadDirs; + UI.AutoloadDirs.Value = configurationFileFormat.AutoloadDirs ?? []; UI.ShownFileTypes.NSP.Value = configurationFileFormat.ShownFileTypes.NSP; UI.ShownFileTypes.PFS0.Value = configurationFileFormat.ShownFileTypes.PFS0; UI.ShownFileTypes.XCI.Value = configurationFileFormat.ShownFileTypes.XCI; @@ -1611,12 +1611,7 @@ namespace Ryujinx.UI.Common.Configuration Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard; Hid.EnableMouse.Value = configurationFileFormat.EnableMouse; Hid.Hotkeys.Value = configurationFileFormat.Hotkeys; - Hid.InputConfig.Value = configurationFileFormat.InputConfig; - - if (Hid.InputConfig.Value == null) - { - Hid.InputConfig.Value = new List(); - } + Hid.InputConfig.Value = configurationFileFormat.InputConfig ?? []; Multiplayer.LanInterfaceId.Value = configurationFileFormat.MultiplayerLanInterfaceId; Multiplayer.Mode.Value = configurationFileFormat.MultiplayerMode;