Commit b07ee652 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Check last committed item when loading data.

Crash reports show that the last committed item can be null.
It is not clear at the moment what steps can be to this scenario, but
this CL adds a check to avoid crashing when this happens.

Bug: 1005210
Change-Id: Ib29b0ffb5e8ca09821c200e1765ba269846ea171
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827283Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701082}
parent 938e46a7
...@@ -144,6 +144,9 @@ enum class BackForwardNavigationType { ...@@ -144,6 +144,9 @@ enum class BackForwardNavigationType {
[_delegate webRequestControllerStopLoading:self]; [_delegate webRequestControllerStopLoading:self];
web::NavigationItemImpl* item = web::NavigationItemImpl* item =
self.navigationManagerImpl->GetLastCommittedItemImpl(); self.navigationManagerImpl->GetLastCommittedItemImpl();
if (!item) {
return;
}
auto navigationContext = web::NavigationContextImpl::CreateNavigationContext( auto navigationContext = web::NavigationContextImpl::CreateNavigationContext(
self.webState, URL, self.webState, URL,
/*has_user_gesture=*/true, item->GetTransitionType(), /*has_user_gesture=*/true, item->GetTransitionType(),
......
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