mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09: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:
@ -109,7 +109,16 @@ namespace osu.Game.Screens.Edit
|
|||||||
if (Beatmap.Value is DummyWorkingBeatmap)
|
if (Beatmap.Value is DummyWorkingBeatmap)
|
||||||
{
|
{
|
||||||
isNewBeatmap = true;
|
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;
|
beatDivisor.Value = Beatmap.Value.BeatmapInfo.BeatDivisor;
|
||||||
|
Reference in New Issue
Block a user