⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 219136 in webkit


Ignore:
Timestamp:
Jul 5, 2017, 10:43:59 AM (9 years ago)
Author:
adachan@apple.com
Message:

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]):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r219135 r219136  
     12017-07-05  Ada Chan  <adachan@apple.com>
     2
     3        Fix crash in UIKit: +[UIViewController _viewControllerForFullScreenPresentationFromView:]
     4        https://bugs.webkit.org/show_bug.cgi?id=174143
     5        <rdar://problem/28384582>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        In -[WKActionSheet willRotate], we can't guarantee that the action sheet belongs
     10        in a window, and passing nil to +[UIViewController _viewControllerForFullScreenPresentationFromView:]
     11        throws an exception. To fix this, bail early if the result from -hostViewForSheet is nil.
     12
     13        * UIProcess/ios/WKActionSheet.mm:
     14        (-[WKActionSheet willRotate]):
     15
    1162017-07-05  Eric Carlson  <eric.carlson@apple.com>
    217
  • trunk/Source/WebKit2/UIProcess/ios/WKActionSheet.mm

    r214455 r219136  
    154154
    155155    UIView *view = [_sheetDelegate hostViewForSheet];
     156    if (!view)
     157        return;
     158
    156159    UIViewController *presentingViewController = [UIViewController _viewControllerForFullScreenPresentationFromView:view];
    157160
Note: See TracChangeset for help on using the changeset viewer.