From 6a690908cfb3c3bbdd094730c2931340f4286cac Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 14 Dec 2017 20:24:24 +0900 Subject: [PATCH] Fix up possible nullref due to early access of Parent --- osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 387a098a5a..f03acb2fa0 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -31,6 +31,9 @@ namespace osu.Game.Rulesets.Osu.UI { get { + if (Parent == null) + return Vector2.Zero; + var parentSize = Parent.DrawSize; var aspectSize = parentSize.X * 0.75f < parentSize.Y ? new Vector2(parentSize.X, parentSize.X * 0.75f) : new Vector2(parentSize.Y * 4f / 3f, parentSize.Y);