mirror of https://github.com/ppy/osu
Fix up possible nullref due to early access of Parent
This commit is contained in:
parent
15c9e4a446
commit
6a690908cf
|
@ -31,6 +31,9 @@ public override Vector2 Size
|
|||
{
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue