diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 433e58a97a..bbdf1ad692 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -1474,6 +1474,8 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, // Scale child QPlatformWindow size. Windows sends WM_DPICHANGE to top-level windows only. for (QWindow *childWindow : platformWindow->window()->findChildren()) { QWindowsWindow *platformChildWindow = static_cast(childWindow->handle()); + if (!platformChildWindow) + continue; QRect currentGeometry = platformChildWindow->geometry(); QRect scaledGeometry = QRect(currentGeometry.topLeft() * scale, currentGeometry.size() * scale); platformChildWindow->setGeometry(scaledGeometry);