Fix DockWidget crach when area is a nullptr. (#582)

When requesting hide on a dockwidget that has been added
to a dockmanager, but isn't yet visible, there was a creash.
The crash has been fixed by moving the code to the existing
guard check for the area.

Co-authored-by: Thorbjørn Lund Martsum <thorbjorn@luxion.com>
This commit is contained in:
tmartsum 2023-12-01 15:13:45 +01:00 committed by GitHub
parent a2c94c16b5
commit 5d6831d179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -749,11 +749,10 @@ void CDockWidget::toggleViewInternal(bool Open)
if (d->DockArea) if (d->DockArea)
{ {
d->DockArea->toggleDockWidgetView(this, Open); d->DockArea->toggleDockWidgetView(this, Open);
} if (d->DockArea->isAutoHide())
{
if (d->DockArea->isAutoHide()) d->DockArea->autoHideDockContainer()->toggleView(Open);
{ }
d->DockArea->autoHideDockContainer()->toggleView(Open);
} }
if (Open && TopLevelDockWidgetBefore) if (Open && TopLevelDockWidgetBefore)