mirror of
https://github.com/osukey/osukey.git
synced 2025-05-21 05:27:17 +09: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
|
namespace osu.Game.Graphics.Backgrounds
|
||||||
{
|
{
|
||||||
[LongRunningLoad]
|
|
||||||
public class SeasonalBackgroundLoader : Component
|
public class SeasonalBackgroundLoader : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user