1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 06:52:55 +08:00

Fix up possible nullref due to early access of Parent

This commit is contained in:
smoogipoo 2017-12-14 20:24:24 +09:00
parent 15c9e4a446
commit 6a690908cf

View File

@ -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);