Null-safety in the case where there are no HitObjects.

This commit is contained in:
smoogipooo
2017-03-14 19:40:51 +09:00
parent c2d80936cf
commit 72e1612f32
2 changed files with 2 additions and 3 deletions

View File

@ -77,8 +77,8 @@ namespace osu.Game.Screens.Select
if (beatmap.Beatmap != null)
{
HitObject lastObject = beatmap.Beatmap.HitObjects.Last();
double endTime = (lastObject as IHasEndTime)?.EndTime ?? lastObject.StartTime;
HitObject lastObject = beatmap.Beatmap.HitObjects.LastOrDefault();
double endTime = (lastObject as IHasEndTime)?.EndTime ?? lastObject?.StartTime ?? 0;
labels.Add(new InfoLabel(new BeatmapStatistic
{