1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 19:13:20 +08:00

Cleanup + actually fix possible nullrefs.

This commit is contained in:
smoogipooo 2017-05-29 11:09:26 +09:00
parent cdf4fcea02
commit cd1da469c7

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?.HitObject ?? hitObjectY?.HitObject) == null)
if (hitObjectX?.HitObject == null || 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?.HitObject ?? hitObjectY?.HitObject) == null)
if (hitObjectX?.HitObject == null || hitObjectY?.HitObject == null)
return base.Compare(x, y);
// Compare by start time