mirror of
https://github.com/ppy/osu.git
synced 2025-02-20 05:36:05 +08:00
Fix possible nullref
This commit is contained in:
parent
2814433d7c
commit
037bd3b463
@ -29,6 +29,12 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
loadPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestNullScore()
|
||||
{
|
||||
loadPanel(null);
|
||||
}
|
||||
|
||||
private void loadPanel(ScoreInfo score) => AddStep("load panel", () =>
|
||||
{
|
||||
Child = new StatisticsPanel
|
||||
|
@ -62,6 +62,9 @@ namespace osu.Game.Screens.Ranking.Statistics
|
||||
|
||||
var newScore = score.NewValue;
|
||||
|
||||
if (newScore == null)
|
||||
return;
|
||||
|
||||
if (newScore.HitEvents == null || newScore.HitEvents.Count == 0)
|
||||
content.Add(new MessagePlaceholder("Score has no statistics :("));
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user