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() private void updateDisplay()
{ {
scoreTable.Scores = new List<ScoreInfo>();
loading = false; loading = false;
var scoreCount = scores?.Count ?? 0; scoreTable.Scores = scores?.Count > 1 ? scores : new List<ScoreInfo>();
if (scoreCount == 0) if (scores.Any())
{ {
topScore.Hide(); topScore.Score = scores.FirstOrDefault();
return; topScore.Show();
} }
else
topScore.Score = scores.FirstOrDefault(); topScore.Hide();
topScore.Show();
if (scoreCount < 2)
return;
scoreTable.Scores = scores;
} }
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)