Skip to content

Commit 5d6831d

Browse files
tmartsumThorbjørn Lund Martsum
and
Thorbjørn Lund Martsum
authored
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 <[email protected]>
1 parent a2c94c1 commit 5d6831d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/DockWidget.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -749,11 +749,10 @@ void CDockWidget::toggleViewInternal(bool Open)
749749
if (d->DockArea)
750750
{
751751
d->DockArea->toggleDockWidgetView(this, Open);
752-
}
753-
754-
if (d->DockArea->isAutoHide())
755-
{
756-
d->DockArea->autoHideDockContainer()->toggleView(Open);
752+
if (d->DockArea->isAutoHide())
753+
{
754+
d->DockArea->autoHideDockContainer()->toggleView(Open);
755+
}
757756
}
758757

759758
if (Open && TopLevelDockWidgetBefore)

0 commit comments

Comments
 (0)