Fix being able to trigger player before carousel is ready

Causes an eventual crash.
This commit is contained in:
Dean Herbert 2018-07-09 18:43:20 +09:00
parent ce0a7d7760
commit 49e94850b6
1 changed files with 4 additions and 0 deletions

View File

@ -231,6 +231,10 @@ public void Edit(BeatmapInfo beatmap)
/// <param name="performStartAction">Whether to trigger <see cref="OnStart"/>.</param>
public void FinaliseSelection(BeatmapInfo beatmap = null, bool performStartAction = true)
{
// avoid attempting to continue before a selection has been obtained.
// this could happen via a user interaction while the carousel is still in a loading state.
if (Carousel.SelectedBeatmap == null) return;
// if we have a pending filter operation, we want to run it now.
// it could change selection (ie. if the ruleset has been changed).
Carousel.FlushPendingFilterOperations();