From b9718cdd5ddfb1b533195e8deda2a3b712795a27 Mon Sep 17 00:00:00 2001 From: fb Date: Tue, 15 Nov 2022 21:23:35 +0100 Subject: [PATCH] CDockAreaWidget::removeDockWidget: guard against nullpointer crash --- src/DockAreaWidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index 26d24cc..a2d8f1c 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -452,6 +452,8 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget, void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget) { ADS_PRINT("CDockAreaWidget::removeDockWidget"); + if(DockWidget == nullptr) + return; auto CurrentDockWidget = currentDockWidget(); auto NextOpenDockWidget = (DockWidget == CurrentDockWidget) ? nextOpenDockWidget(DockWidget) : nullptr;