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

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

@ -1,7 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Samples;
namespace osu.Game.Modes.Objects

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
{