mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 18:32:56 +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:
parent
ea007af572
commit
a9a3489e92
@ -15,7 +15,6 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Graphics.Backgrounds
|
||||
{
|
||||
[LongRunningLoad]
|
||||
public class SeasonalBackgroundLoader : Component
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -44,6 +44,8 @@ namespace osu.Game.Screens.Backgrounds
|
||||
mode = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource);
|
||||
introSequence = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence);
|
||||
|
||||
AddInternal(seasonalBackgroundLoader);
|
||||
|
||||
user.ValueChanged += _ => Next();
|
||||
skin.ValueChanged += _ => Next();
|
||||
mode.ValueChanged += _ => Next();
|
||||
@ -53,7 +55,6 @@ namespace osu.Game.Screens.Backgrounds
|
||||
|
||||
currentDisplay = RNG.Next(0, background_count);
|
||||
|
||||
LoadComponentAsync(seasonalBackgroundLoader);
|
||||
Next();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user