mirror of
https://github.com/ppy/osu.git
synced 2026-05-21 18:10:40 +08: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:
+1
-1
Submodule osu-framework updated: 5e03872703...92db4fc015
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user