iOS: check if Qt has an active window before scrolling to cursor

In hybrid applications an external view can be first reponder. And when
that is the case, Qt will have no active windows and focusView will return 0.
We therefore need to protect scrollToCursor from this case, so it doesn't try
to access e.g focusView().window, which will lead to a crash.

Task-number: QTBUG-45182
Change-Id: I87d470631f5beda22fd64fc1f2b0f7259344f830
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
Richard Moe Gustavsen 2015-03-30 15:11:37 +02:00
parent ce4a759c3d
commit 9cb38baaf8

View File

@ -437,6 +437,9 @@ void QIOSInputContext::scrollToCursor()
if (!rootView)
return;
if (!focusView())
return;
if (rootView.window != focusView().window)
return;