From a2ef086c1f23ebf9873ef55b6c4766983d9be455 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 9 Mar 2022 01:08:11 +0900 Subject: [PATCH] Fix potential crash on rare incorrect firing of skin dropdown update methods As brought to light by https://gist.github.com/smoogipoo/56eda7ab56b9d1966556f2ca7a80a847. There's a chance that the dropdown is not populated by the time `updateSelectedSkinFromConfig` is fired via an external means (config changes). --- osu.Game/Overlays/Settings/Sections/SkinSection.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index 1dfe49945f..475c4bff8d 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -134,6 +134,9 @@ namespace osu.Game.Overlays.Settings.Sections private void updateSelectedSkinFromConfig() { + if (!skinDropdown.Items.Any()) + return; + Live skin = null; if (Guid.TryParse(configBindable.Value, out var configId))