From 0793b0f0abf827976f0b813170ff933d44ea31fa Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Dec 2021 16:37:29 +0900 Subject: [PATCH] Fix `Max` lookup methods not checking for zero beatmap count --- osu.Game/Beatmaps/BeatmapSetInfo.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapSetInfo.cs b/osu.Game/Beatmaps/BeatmapSetInfo.cs index 4aea0c6ce8..ed16e3a965 100644 --- a/osu.Game/Beatmaps/BeatmapSetInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetInfo.cs @@ -50,11 +50,11 @@ namespace osu.Game.Beatmaps /// public bool Protected { get; set; } - public double MaxStarDifficulty => Beatmaps.Max(b => b.StarRating); + public double MaxStarDifficulty => Beatmaps.Count == 0 ? 0 : Beatmaps.Max(b => b.StarRating); - public double MaxLength => Beatmaps.Max(b => b.Length); + public double MaxLength => Beatmaps.Count == 0 ? 0 : Beatmaps.Max(b => b.Length); - public double MaxBPM => Beatmaps.Max(b => b.BPM); + public double MaxBPM => Beatmaps.Count == 0 ? 0 : Beatmaps.Max(b => b.BPM); /// /// Returns the storage path for the file in this beatmapset with the given filename, if any exists, otherwise null.