mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 07:32:55 +08:00
Fix possible nullrefs.
This commit is contained in:
parent
731c15f91a
commit
9e5a53aae7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user