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

Rewrite updateDisplay logic to not fail on some cases

This commit is contained in:
Dean Herbert 2019-04-03 18:29:46 +09:00
parent 5c3c08566f
commit a15a9bd03a

View File

@ -121,25 +121,17 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
private void updateDisplay()
{
scoreTable.Scores = new List<ScoreInfo>();
loading = false;
var scoreCount = scores?.Count ?? 0;
scoreTable.Scores = scores?.Count > 1 ? scores : new List<ScoreInfo>();
if (scoreCount == 0)
if (scores.Any())
{
topScore.Hide();
return;
topScore.Score = scores.FirstOrDefault();
topScore.Show();
}
topScore.Score = scores.FirstOrDefault();
topScore.Show();
if (scoreCount < 2)
return;
scoreTable.Scores = scores;
else
topScore.Hide();
}
protected override void Dispose(bool isDisposing)