From fa8786c3971ba1614d7b6357a2dcb87fc9cdc91d Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 21 Aug 2013 14:10:29 +0200 Subject: [PATCH] Android: Fix crash when hitting Back button to quit On Android, it's possible to reach the condition when window == 0 if you hit the Back key, since the previous bail-out is disabled for this case. To avoid a null-pointer dereference, an extra check is required. Change-Id: Ic898cd82dd6e52c24505dd2248c98efcefc15b1c Reviewed-by: Paul Olav Tvete --- src/gui/kernel/qguiapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 7d2c710c52..6653d5a207 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1557,7 +1557,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE ) { return; } - if (window->d_func()->blockedByModalWindow) { + if (window && window->d_func()->blockedByModalWindow) { // a modal window is blocking this window, don't allow key events through return; }