1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:47:25 +08:00

Merge pull request #4782 from Altenhh/noObjectsFix

Fix hard crash if beatmap does not have any objects
This commit is contained in:
Dan Balasescu 2019-05-15 11:27:52 +09:00 committed by GitHub
commit 5a9f8e5820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,8 +63,10 @@ namespace osu.Game.Rulesets.Osu.UI
{ {
get get
{ {
var first = (OsuHitObject)Objects.First(); if (Objects.FirstOrDefault() is OsuHitObject first)
return first.StartTime - Math.Max(2000, first.TimePreempt); return first.StartTime - Math.Max(2000, first.TimePreempt);
return 0;
} }
} }
} }