Commit 928fbd9f authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Fix a crash with Universal Links.

Nil-check the URL before feeding it to the Universal Link API.

Bug: 1051802
Change-Id: I357880d0ffbd512de85c50a461f01fdd8ba238a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062253
Commit-Queue: Avi Drissman <avi@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742196}
parent dc62490c
......@@ -57,8 +57,11 @@ SFUniversalLink* API_AVAILABLE(macos(10.15)) GetUniversalLink(const GURL& url) {
if (!safari_services || !SFUniversalLink_class)
return nil;
return [[[SFUniversalLink_class alloc]
initWithWebpageURL:net::NSURLWithGURL(url)] autorelease];
NSURL* nsurl = net::NSURLWithGURL(url);
if (!nsurl)
return nil;
return [[[SFUniversalLink_class alloc] initWithWebpageURL:nsurl] autorelease];
}
base::Optional<IntentPickerAppInfo> AppInfoForUrl(const GURL& url) {
......
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