Commit 1b116856 authored by edchin's avatar edchin Committed by Commit Bot

[ios] Fix for Pointer Interaction crash

Bug: 1106960
Change-Id: I67369d256f438db7c89e2105df5a6f4677ce296b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2333388
Commit-Queue: edchin <edchin@chromium.org>
Auto-Submit: edchin <edchin@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794627}
parent b6dbceea
...@@ -519,6 +519,17 @@ UIImage* DefaultFaviconImage() { ...@@ -519,6 +519,17 @@ UIImage* DefaultFaviconImage() {
- (UIPointerStyle*)pointerInteraction:(UIPointerInteraction*)interaction - (UIPointerStyle*)pointerInteraction:(UIPointerInteraction*)interaction
styleForRegion:(UIPointerRegion*)region styleForRegion:(UIPointerRegion*)region
API_AVAILABLE(ios(13.4)) { API_AVAILABLE(ios(13.4)) {
// Hovering over this tab view and closing the tab simultaneously could result
// in this tab view having been removed from the window at the beginning of
// this method. If this tab view has already been removed from the view
// hierarchy, a nil pointer style should be returned so that the pointer
// remains with a default style. Attempting to construct a UITargetedPreview
// with a tab view that has already been removed from the hierarchy will
// result in a crash with an exception stating that the view has no window.
if (!_backgroundImageView.window) {
return nil;
}
UIPreviewParameters* parameters = [[UIPreviewParameters alloc] init]; UIPreviewParameters* parameters = [[UIPreviewParameters alloc] init];
parameters.visiblePath = [self borderPath]; parameters.visiblePath = [self borderPath];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment