1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Fix potential null reference when loading background

As seen in
https://discordapp.com/channels/188630481301012481/188630652340404224/772094427342569493.
Caused due to async load of the loader, which means it may not be ready
before Next() is called.
This commit is contained in:
Dean Herbert 2020-10-31 22:51:31 +09:00
parent ea007af572
commit a9a3489e92
2 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,6 @@ using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Graphics.Backgrounds namespace osu.Game.Graphics.Backgrounds
{ {
[LongRunningLoad]
public class SeasonalBackgroundLoader : Component public class SeasonalBackgroundLoader : Component
{ {
/// <summary> /// <summary>

View File

@ -44,6 +44,8 @@ namespace osu.Game.Screens.Backgrounds
mode = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource); mode = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource);
introSequence = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence); introSequence = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence);
AddInternal(seasonalBackgroundLoader);
user.ValueChanged += _ => Next(); user.ValueChanged += _ => Next();
skin.ValueChanged += _ => Next(); skin.ValueChanged += _ => Next();
mode.ValueChanged += _ => Next(); mode.ValueChanged += _ => Next();
@ -53,7 +55,6 @@ namespace osu.Game.Screens.Backgrounds
currentDisplay = RNG.Next(0, background_count); currentDisplay = RNG.Next(0, background_count);
LoadComponentAsync(seasonalBackgroundLoader);
Next(); Next();
} }