mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 18:53:21 +08:00
Null-safety in the case where there are no HitObjects.
This commit is contained in:
parent
c2d80936cf
commit
72e1612f32
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user