diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index c5d88b198b..a4b5376b6f 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2393,7 +2393,8 @@ void QWindowPrivate::setCursor(const QCursor *newCursor) hasCursor = false; } // Only attempt to set cursor and emit signal if there is an actual platform cursor - if (q->screen()->handle()->cursor()) { + QScreen* screen = q->screen(); + if (screen && screen->handle()->cursor()) { applyCursor(); QEvent event(QEvent::CursorChange); QGuiApplication::sendEvent(q, &event);