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

Also handle null SelectedItem for safety

This commit is contained in:
Dan Balasescu 2022-02-04 17:53:30 +09:00
parent b41655d5b9
commit 0473c6c52f

View File

@ -461,7 +461,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
// This is an issue with MultiSpectatorScreen which is effectively in an always "ready" state and receives LoadRequested() callbacks
// even when it is not truly ready (i.e. the beatmap hasn't been selected by the client yet). For the time being, a simple fix to this is to ignore the callback.
// Note that spectator will be entered automatically when the client is capable of doing so via beatmap availability callbacks (see: updateBeatmapAvailability()).
if (client.LocalUser?.State == MultiplayerUserState.Spectating && Beatmap.IsDefault)
if (client.LocalUser?.State == MultiplayerUserState.Spectating && (SelectedItem.Value == null || Beatmap.IsDefault))
return;
StartPlay();