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 <paul.tvete@digia.com>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2013-08-21 14:10:29 +02:00 committed by The Qt Project
parent 31e665c7cd
commit fa8786c397

View File

@ -1557,7 +1557,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
) { ) {
return; 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 // a modal window is blocking this window, don't allow key events through
return; return;
} }