Commit 3ad26936 authored by stkhapugin@chromium.org's avatar stkhapugin@chromium.org Committed by Commit Bot

Fix a crash in Geolocation Controller.

Fixes a crash when there is no visible item.

Bug: 819200
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Icc97de304a7720d7866b309cc436eb2938c833ce
Reviewed-on: https://chromium-review.googlesource.com/1170778
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584399}
parent bd6c7f9f
...@@ -457,7 +457,8 @@ const char* const kGeolocationAuthorizationActionNewUser = ...@@ -457,7 +457,8 @@ const char* const kGeolocationAuthorizationActionNewUser =
web::NavigationManager* navigationManager = web::NavigationManager* navigationManager =
tab.webState->GetNavigationManager(); tab.webState->GetNavigationManager();
web::NavigationItem* item = navigationManager->GetVisibleItem(); web::NavigationItem* item = navigationManager->GetVisibleItem();
if ([self addLocationToNavigationItem:item browserState:tab.browserState]) { if (item &&
[self addLocationToNavigationItem:item browserState:tab.browserState]) {
navigationManager->Reload(web::ReloadType::NORMAL, navigationManager->Reload(web::ReloadType::NORMAL,
false /* check_for_repost */); false /* check_for_repost */);
} }
......
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