mirror of
https://github.com/ppy/osu
synced 2024-12-15 19:36:34 +00:00
Set StarDifficulty to -1 for invalid beatmaps
The StarDifficulty calculation in a BeatmapGroup would not properly deal with Beatmaps that cannot be loaded and thus cause a NullReferenceException when trying to work with them, instead of assigning a StarDifficulty of -1 to signify that the map is invalid.
This commit is contained in:
parent
8d91519d59
commit
0d1dec665a
@ -1 +1 @@
|
||||
Subproject commit 5e038727036aec5cb0005a4eab30fd73fa5ceb18
|
||||
Subproject commit 92db4fc015274a4b8a74d9adb2d7a68b8be2134c
|
@ -64,7 +64,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
BeatmapSet = beatmapSet;
|
||||
WorkingBeatmap beatmap = database.GetWorkingBeatmap(BeatmapSet.Beatmaps.FirstOrDefault());
|
||||
foreach (var b in BeatmapSet.Beatmaps)
|
||||
b.StarDifficulty = (float)database.GetWorkingBeatmap(b).Beatmap.CalculateStarDifficulty();
|
||||
b.StarDifficulty = (float)(database.GetWorkingBeatmap(b).Beatmap?.CalculateStarDifficulty() ?? -1f);
|
||||
|
||||
Header = new BeatmapSetHeader(beatmap)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user