Always return a non-null container for SkinComponentsContainerLookups

This commit is contained in:
Dean Herbert 2023-02-16 19:25:55 +09:00
parent 4cc6664dc7
commit 9685fb2114
2 changed files with 5 additions and 7 deletions

View File

@ -347,7 +347,7 @@ namespace osu.Game.Skinning
switch (containerLookup.Target)
{
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
var skinnableTargetWrapper = new DefaultSkinComponentsContainer(container =>
return new DefaultSkinComponentsContainer(container =>
{
var score = container.OfType<LegacyScoreCounter>().FirstOrDefault();
var accuracy = container.OfType<GameplayAccuracyCounter>().FirstOrDefault();
@ -387,8 +387,6 @@ namespace osu.Game.Skinning
new BarHitErrorMeter(),
}
};
return skinnableTargetWrapper;
}
return null;

View File

@ -66,10 +66,10 @@ namespace osu.Game.Skinning
components.Clear();
ComponentsLoaded = false;
if (componentsContainer == null)
return;
content = componentsContainer;
content = componentsContainer ?? new Container
{
RelativeSizeAxes = Axes.Both
};
cancellationSource?.Cancel();
cancellationSource = null;