mirror of https://github.com/ppy/osu
Fix `Max` lookup methods not checking for zero beatmap count
This commit is contained in:
parent
dcd69e852e
commit
0793b0f0ab
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue