summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kde.org>2013-10-27 10:20:32 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-28 12:05:22 +0100
commit684a952edbf5ec5bd70c7edae7c8eff8e87cf2de (patch)
treeb61164fe0ae7f26372d57a06de14302a224c57e9 /src/plugins/platforms
parent8d1ab25ed2864bda530aec5ca76ad3ba35b2a55f (diff)
Android: Don't crash if the screen is not yet initialized.
Change-Id: I4751c2dec5780f42b348a8a8ea628f65d548dcec Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/android/src/androidjnimain.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp
index 34413ae509..abfc2fa19c 100644
--- a/src/plugins/platforms/android/src/androidjnimain.cpp
+++ b/src/plugins/platforms/android/src/androidjnimain.cpp
@@ -559,8 +559,10 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface)
QPlatformScreen *screen = m_androidPlatformIntegration->screen();
QRect geometry(QPoint(0, 0), size);
- QWindowSystemInterface::handleScreenAvailableGeometryChange(screen->screen(), geometry);
- QWindowSystemInterface::handleScreenGeometryChange(screen->screen(), geometry);
+ if (screen) {
+ QWindowSystemInterface::handleScreenAvailableGeometryChange(screen->screen(), geometry);
+ QWindowSystemInterface::handleScreenGeometryChange(screen->screen(), geometry);
+ }
if (!sameNativeWindow) {
m_surfaceMutex.unlock();