1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 20:22:55 +08:00

Fix check crash on empty beatmap

This commit is contained in:
Bartłomiej Dach 2024-03-19 19:17:22 +01:00
parent 0211ae12ad
commit 2b83e6bc4c
No known key found for this signature in database

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Edit.Checks.Components;
using osu.Game.Storyboards;
@ -21,7 +22,7 @@ namespace osu.Game.Rulesets.Edit.Checks
public IEnumerable<Issue> Run(BeatmapVerifierContext context)
{
double mappedLength = context.Beatmap.GetLastObjectTime();
double mappedLength = context.Beatmap.HitObjects.Any() ? context.Beatmap.GetLastObjectTime() : 0;
double trackLength = context.WorkingBeatmap.Track.Length;
double mappedPercentage = Math.Round(mappedLength / trackLength * 100);