diff --git a/src/DockFocusController.cpp b/src/DockFocusController.cpp index 77e73c11..6f3318a6 100644 --- a/src/DockFocusController.cpp +++ b/src/DockFocusController.cpp @@ -240,7 +240,11 @@ void CDockFocusController::onApplicationFocusChanged(QWidget* focusedOld, QWidge auto OtherDockWidgetTab = internal::findParent(focusedNow); if (OtherDockWidgetTab && focusedOld) { - focusedOld->setFocus(); + auto OldFocusedDockWidget = internal::findParent(focusedOld); + if (OldFocusedDockWidget) + { + focusedOld->setFocus(); + } return; } }