From f5f925fab36d1475bc11e72982f713b8c025a461 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 26 May 2023 23:08:45 +0200 Subject: [PATCH] fixed an exception when a panel that is not currently part of a ui has a child removed (since 3127ad5) --- MLEM.Ui/Elements/Panel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index 6a22775..d523b17 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -136,7 +136,8 @@ namespace MLEM.Ui.Elements { // when removing children, our scroll bar might have to be hidden // if we don't do this before adding children again, they might incorrectly assume that the scroll bar will still be visible and adjust their size accordingly - this.ScrollSetup(); + if (this.System != null) + this.ScrollSetup(); } ///