1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 10:42:54 +08:00

Fix possible nullrefs.

This commit is contained in:
smoogipooo 2017-05-29 10:53:55 +09:00
parent 731c15f91a
commit 9e5a53aae7

View File

@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Objects
var hitObjectY = y as DrawableHitObject;
// If either of the two drawables are not hit objects, fall back to the base comparer
if ((hitObjectX ?? hitObjectY) == null)
if ((hitObjectX?.HitObject ?? hitObjectY?.HitObject) == null)
return base.Compare(x, y);
// Compare by start time
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Objects
var hitObjectY = y as DrawableHitObject;
// If either of the two drawables are not hit objects, fall back to the base comparer
if ((hitObjectX ?? hitObjectY) == null)
if ((hitObjectX?.HitObject ?? hitObjectY?.HitObject) == null)
return base.Compare(x, y);
// Compare by start time