1
0
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:
smoogipoo 2020-06-19 22:47:55 +09:00
parent 2814433d7c
commit 037bd3b463
2 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -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