Increase safety of score lookups when leaderboard isn't visible.

This commit is contained in:
Dean Herbert 2017-04-24 18:48:28 +09:00
parent ee659e7307
commit 4fa22146b8
1 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,7 @@
using osu.Framework.Graphics.Primitives;
using System;
using osu.Framework.Allocation;
using osu.Framework.Threading;
using osu.Game.Database;
using osu.Game.Rulesets.Scoring;
using osu.Game.Online.API;
@ -93,13 +94,18 @@ public Leaderboard()
private BeatmapInfo beatmap;
private ScheduledDelegate pendingBeatmapSwitch;
public BeatmapInfo Beatmap
{
get { return beatmap; }
set
{
beatmap = value;
Schedule(updateScores);
Scores = null;
pendingBeatmapSwitch?.Cancel();
pendingBeatmapSwitch = Schedule(updateScores);
}
}