diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp index 43db0e5f8e..05d04ae4ee 100644 --- a/src/gui/kernel/qplatformscreen.cpp +++ b/src/gui/kernel/qplatformscreen.cpp @@ -232,6 +232,10 @@ void QPlatformScreen::setOrientationUpdateMask(Qt::ScreenOrientations mask) QPlatformScreen * QPlatformScreen::platformScreenForWindow(const QWindow *window) { + // QTBUG 32681: It can happen during the transition between screens + // when one screen is disconnected that the window doesn't have a screen. + if (!window->screen()) + return 0; return window->screen()->handle(); }