1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

try-catch more

This commit is contained in:
Dean Herbert 2023-06-09 17:33:59 +09:00
parent 67562a3856
commit a9071e7afd

View File

@ -902,25 +902,24 @@ namespace osu.Game.Database
foreach (var score in scores)
{
string? replayFilename = score.Files.FirstOrDefault(f => f.Filename.EndsWith(@".osr", StringComparison.InvariantCultureIgnoreCase))?.File.GetStoragePath();
if (replayFilename == null)
continue;
using (var stream = files.Store.GetStream(replayFilename))
try
{
if (stream == null)
continue;
try
using (var stream = files.Store.GetStream(replayFilename))
{
if (stream == null)
continue;
int version = new ReplayVersionParser().Parse(stream);
if (version < LegacyScoreEncoder.FIRST_LAZER_VERSION)
score.IsLegacyScore = true;
}
catch (Exception e)
{
Logger.Error(e, $"Failed to read replay {replayFilename}", LoggingTarget.Database);
}
}
catch (Exception e)
{
Logger.Error(e, $"Failed to read replay {replayFilename}", LoggingTarget.Database);
}
}