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
1 changed files with 4 additions and 2 deletions

View File

@ -63,8 +63,10 @@ public override double GameplayStartTime
{
get
{
var first = (OsuHitObject)Objects.First();
return first.StartTime - Math.Max(2000, first.TimePreempt);
if (Objects.FirstOrDefault() is OsuHitObject first)
return first.StartTime - Math.Max(2000, first.TimePreempt);
return 0;
}
}
}