1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 09:22:54 +08:00

Don't create a new request if onlineId is null

This commit is contained in:
Andrei Zavatski 2019-08-12 09:45:21 +03:00
parent 6095480a54
commit 520924b440

View File

@ -40,15 +40,15 @@ namespace osu.Game.Screens.Multi.Match.Components
panel = null;
}
var onlineId = item.NewValue?.Beatmap.OnlineBeatmapID ?? 0;
var onlineId = item.NewValue?.Beatmap.OnlineBeatmapID;
if (onlineId != 0)
if (onlineId.HasValue)
{
request = new GetBeatmapSetRequest(onlineId, BeatmapSetLookupType.BeatmapId);
request = new GetBeatmapSetRequest(onlineId.Value, BeatmapSetLookupType.BeatmapId);
request.Success += beatmap =>
{
panel = new DirectGridPanel(beatmap.ToBeatmapSet(rulesets));
LoadComponentAsync(panel, p => { AddInternal(panel); });
LoadComponentAsync(panel, p => { AddInternal(p); });
};
api.Queue(request);
}