Commit c751db7d authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Early return if webState is not valid

Sometimes [ToolbarMediator updateShareMenuForWebState:]
is passed a null WebState, so do nothing if that is the case.

Bug: 
Change-Id: Id083687df59199489a80ca21a9182113e2ad62ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2354710
Auto-Submit: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797763}
parent e82c94cb
...@@ -321,6 +321,8 @@ ...@@ -321,6 +321,8 @@
// Updates the Share Menu button of the consumer. // Updates the Share Menu button of the consumer.
- (void)updateShareMenuForWebState:(web::WebState*)webState { - (void)updateShareMenuForWebState:(web::WebState*)webState {
if (!self.webState)
return;
const GURL& URL = webState->GetLastCommittedURL(); const GURL& URL = webState->GetLastCommittedURL();
BOOL shareMenuEnabled = BOOL shareMenuEnabled =
URL.is_valid() && !web::GetWebClient()->IsAppSpecificURL(URL); URL.is_valid() && !web::GetWebClient()->IsAppSpecificURL(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