From d465d9f2300f57e78cd954a44ae70f2464301cc3 Mon Sep 17 00:00:00 2001 From: xucs007 Date: Tue, 1 Aug 2023 11:34:09 +0800 Subject: [PATCH] fix #669: dmledit crash on resize --- src/dlangui/widgets/layouts.d | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/dlangui/widgets/layouts.d b/src/dlangui/widgets/layouts.d index 13d1b09d..22721068 100644 --- a/src/dlangui/widgets/layouts.d +++ b/src/dlangui/widgets/layouts.d @@ -519,10 +519,14 @@ class ResizerWidget : Widget { private void resizeAndFireEvent(short newWidth, ResizerEventType type) { // Respect the dimensions - if(newWidth > minPreviousItemWidth && newWidth < (parent.width - minWidth - minNextItemWidth) && - newWidth > _previousWidget.minWidth() && newWidth < (parent.width - minWidth - _nextWidget.minWidth())) + if( (newWidth > minPreviousItemWidth) && (newWidth < (parent.width - minWidth - minNextItemWidth)) && (_previousWidget is null || + ( (newWidth > _previousWidget.minWidth) && + (newWidth < (parent.width - minWidth - _nextWidget.minWidth)) + ))) { - _previousWidget.layoutWidth = newWidth; + if (_previousWidget !is null) { + _previousWidget.layoutWidth = newWidth; + } if (resizeEvent.assigned) { resizeEvent(this, type, newWidth);