From eac21012089657f3e29df89292decbae416fe4e2 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Wed, 8 Jan 2025 08:54:17 +0100 Subject: [PATCH] contentContainer could be null if parent class sets width in ctor --- haxe/ui/containers/Panel.hx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/haxe/ui/containers/Panel.hx b/haxe/ui/containers/Panel.hx index 38c5ebc52..69d120ea6 100644 --- a/haxe/ui/containers/Panel.hx +++ b/haxe/ui/containers/Panel.hx @@ -57,12 +57,17 @@ class Panel extends VBox { #if (haxeui_openfl || haxeui_nme || haxeui_flixel) public override function set_width(value:Float):Float { - contentContainer.percentWidth = 100; + trace(contentContainer); + if (contentContainer != null) { + contentContainer.percentWidth = 100; + } return super.set_width(value); } public override function set_height(value:Float):Float { - contentContainer.percentHeight = 100; + if (contentContainer != null) { + contentContainer.percentHeight = 100; + } return super.set_height(value); }