1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 17:13:06 +08:00

Handle case where SkinManager sources aren't part of AllSources

In tests.
This commit is contained in:
Salman Ahmed 2021-06-23 10:44:21 +03:00
parent 53fa229880
commit d484469906

View File

@ -87,7 +87,11 @@ namespace osu.Game.Skinning
}
}
SkinSources.Insert(SkinSources.IndexOf(skinManager.DefaultSkin), new RulesetResourcesSkin(Ruleset, host, audio));
var defaultSkinIndex = SkinSources.IndexOf(skinManager.DefaultSkin);
if (defaultSkinIndex >= 0)
SkinSources.Insert(defaultSkinIndex, new RulesetResourcesSkin(Ruleset, host, audio));
else
SkinSources.Add(new RulesetResourcesSkin(Ruleset, host, audio));
}
protected ISkin GetLegacyRulesetTransformedSkin(ISkin legacySkin)