diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index ead29556b7..18e62b26d4 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -827,7 +827,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, // TODO: Release/regrab mouse if a popup has mouse grab. return false; case QtWindows::DestroyEvent: - if (!platformWindow->testFlag(QWindowsWindow::WithinDestroy)) { + if (platformWindow && !platformWindow->testFlag(QWindowsWindow::WithinDestroy)) { qWarning() << "External WM_DESTROY received for " << platformWindow->window() << ", parent: " << platformWindow->window()->parent() << ", transient parent: " << platformWindow->window()->transientParent();