Fix `Max` lookup methods not checking for zero beatmap count

This commit is contained in:
Dean Herbert 2021-12-21 16:37:29 +09:00
parent dcd69e852e
commit 0793b0f0ab
1 changed files with 3 additions and 3 deletions

View File

@ -50,11 +50,11 @@ public BeatmapOnlineStatus Status
/// </summary>
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);
/// <summary>
/// Returns the storage path for the file in this beatmapset with the given filename, if any exists, otherwise null.