Fix crash in UIKit: +[UIViewController _viewControllerForFullScreenPresentationFromView:]
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jul 2017 17:43:59 +0000 (17:43 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jul 2017 17:43:59 +0000 (17:43 +0000)
commit3f3e0149cb288ed94a90ffa831d4d09a6c607029
tree716fe598117b1dd24fbbc69020d20196a77d195a
parentd2075bc52eefc1c8ea7cc3b74d5cd0a2f942b0f1
Fix crash in UIKit: +[UIViewController _viewControllerForFullScreenPresentationFromView:]
https://bugs.webkit.org/show_bug.cgi?id=174143
<rdar://problem/28384582>

Reviewed by Wenson Hsieh.

In -[WKActionSheet willRotate], we can't guarantee that the action sheet belongs
in a window, and passing nil to +[UIViewController _viewControllerForFullScreenPresentationFromView:]
throws an exception. To fix this, bail early if the result from -hostViewForSheet is nil.

* UIProcess/ios/WKActionSheet.mm:
(-[WKActionSheet willRotate]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ios/WKActionSheet.mm