mirror of
https://github.com/ppy/osu.git
synced 2025-03-21 17:57:46 +08:00
Merge pull request #11569 from peppy/fix-editor-new-beatmap-crash
Fix a potential crash when exiting the editor before a new beatmap is added to the database
This commit is contained in:
commit
c70dd2edfc
@ -109,7 +109,16 @@ namespace osu.Game.Screens.Edit
|
||||
if (Beatmap.Value is DummyWorkingBeatmap)
|
||||
{
|
||||
isNewBeatmap = true;
|
||||
Beatmap.Value = beatmapManager.CreateNew(Ruleset.Value, api.LocalUser.Value);
|
||||
|
||||
var newBeatmap = beatmapManager.CreateNew(Ruleset.Value, api.LocalUser.Value);
|
||||
|
||||
// this is a bit haphazard, but guards against setting the lease Beatmap bindable if
|
||||
// the editor has already been exited.
|
||||
if (!ValidForPush)
|
||||
return;
|
||||
|
||||
// this probably shouldn't be set in the asynchronous load method, but everything following relies on it.
|
||||
Beatmap.Value = newBeatmap;
|
||||
}
|
||||
|
||||
beatDivisor.Value = Beatmap.Value.BeatmapInfo.BeatDivisor;
|
||||
|
Loading…
x
Reference in New Issue
Block a user