1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:07:52 +08:00

Allow legacy score to be constructed even if replay file is missing

This commit is contained in:
Dean Herbert 2020-06-15 20:31:47 +09:00
parent c3c5a99a22
commit 90d69c1216

View File

@ -16,7 +16,10 @@ namespace osu.Game.Scoring
{
ScoreInfo = score;
var replayFilename = score.Files.First(f => f.Filename.EndsWith(".osr", StringComparison.InvariantCultureIgnoreCase)).FileInfo.StoragePath;
var replayFilename = score.Files.FirstOrDefault(f => f.Filename.EndsWith(".osr", StringComparison.InvariantCultureIgnoreCase))?.FileInfo.StoragePath;
if (replayFilename == null)
return;
using (var stream = store.GetStream(replayFilename))
Replay = new DatabasedLegacyScoreDecoder(rulesets, beatmaps).Parse(stream).Replay;