1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:13:21 +08:00

Fix potential nullref during display due to incorrect equality check

This commit is contained in:
Dean Herbert 2022-02-01 16:13:27 +09:00
parent e1b57c4bf6
commit 855135c51e

View File

@ -15,6 +15,8 @@ using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.UI;
#nullable enable
namespace osu.Game.Online.Leaderboards
{
public class LeaderboardScoreTooltip : VisibilityContainer, ITooltip<ScoreInfo>
@ -94,14 +96,14 @@ namespace osu.Game.Online.Leaderboards
};
}
private ScoreInfo currentScore;
private ScoreInfo? displayedScore;
public void SetContent(ScoreInfo score)
{
if (currentScore.Equals(score))
if (displayedScore?.Equals(score) == true)
return;
currentScore = score;
displayedScore = score;
timestampLabel.Text = $"Played on {score.Date.ToLocalTime():d MMMM yyyy HH:mm}";