From 31e26c2c1cd60aa1edb180b318733540ebac23cb Mon Sep 17 00:00:00 2001 From: Rodrigo Oliva Date: Wed, 20 Oct 2021 16:54:47 +0200 Subject: [PATCH] Fix crash when adding closed dock widgets to the manager. (#366) Co-authored-by: Rodrigo Oliva --- src/DockWidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DockWidget.cpp b/src/DockWidget.cpp index 42641ee..1d4515c 100644 --- a/src/DockWidget.cpp +++ b/src/DockWidget.cpp @@ -597,7 +597,8 @@ void CDockWidget::toggleViewInternal(bool Open) CDockWidget* TopLevelDockWidgetAfter = DockContainer ? DockContainer->topLevelDockWidget() : nullptr; CDockWidget::emitTopLevelEventForWidget(TopLevelDockWidgetAfter, true); - CFloatingDockContainer* FloatingContainer = DockContainer->floatingWidget(); + CFloatingDockContainer* FloatingContainer = DockContainer + ? DockContainer->floatingWidget() : nullptr; if (FloatingContainer) { FloatingContainer->updateWindowTitle();