mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 18:42:56 +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));
|
loadPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestNullScore()
|
||||||
|
{
|
||||||
|
loadPanel(null);
|
||||||
|
}
|
||||||
|
|
||||||
private void loadPanel(ScoreInfo score) => AddStep("load panel", () =>
|
private void loadPanel(ScoreInfo score) => AddStep("load panel", () =>
|
||||||
{
|
{
|
||||||
Child = new StatisticsPanel
|
Child = new StatisticsPanel
|
||||||
|
@ -62,6 +62,9 @@ namespace osu.Game.Screens.Ranking.Statistics
|
|||||||
|
|
||||||
var newScore = score.NewValue;
|
var newScore = score.NewValue;
|
||||||
|
|
||||||
|
if (newScore == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (newScore.HitEvents == null || newScore.HitEvents.Count == 0)
|
if (newScore.HitEvents == null || newScore.HitEvents.Count == 0)
|
||||||
content.Add(new MessagePlaceholder("Score has no statistics :("));
|
content.Add(new MessagePlaceholder("Score has no statistics :("));
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user