mirror of
https://github.com/ppy/osu.git
synced 2025-03-25 11:47:19 +08:00
Add null check on replay as safety measure
This commit is contained in:
parent
400542bc0b
commit
9bac8f3792
@ -63,7 +63,11 @@ namespace osu.Game.Screens.Play
|
||||
Origin = Anchor.Centre,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
spectatorStreaming.OnUserBeganPlaying += userBeganPlaying;
|
||||
spectatorStreaming.OnUserFinishedPlaying += userFinishedPlaying;
|
||||
spectatorStreaming.OnNewFrames += userSentFrames;
|
||||
@ -76,6 +80,11 @@ namespace osu.Game.Screens.Play
|
||||
if (userId != targetUser.Id)
|
||||
return;
|
||||
|
||||
// this should never happen as the server sends the user's state on watching,
|
||||
// but is here as a safety measure.
|
||||
if (replay == null)
|
||||
return;
|
||||
|
||||
var rulesetInstance = ruleset.Value.CreateInstance();
|
||||
|
||||
foreach (var frame in data.Frames)
|
||||
|
Loading…
x
Reference in New Issue
Block a user