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; 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 => request.Success += beatmap =>
{ {
panel = new DirectGridPanel(beatmap.ToBeatmapSet(rulesets)); panel = new DirectGridPanel(beatmap.ToBeatmapSet(rulesets));
LoadComponentAsync(panel, p => { AddInternal(panel); }); LoadComponentAsync(panel, p => { AddInternal(p); });
}; };
api.Queue(request); api.Queue(request);
} }