Gracefully handle null pending item inside webView:didCommitNavigation:.

webView:didCommitNavigation: used to assume that pending item is
always valid and crashed on dereferencing null pointer. Pending item
should never be null inside webView:didCommitNavigation: but existing
ownership model is incorrect, so pending item could be distroyed before

This CL adds checks before dereferencing pending item to avoid the
crash. The real fix could be implemented by storing pending item in
NavigationContext object (

Bug: 676458
Change-Id: Idf60e60cbe98111e8fed5d2903ae8bc8b8df3d90
Reviewed-by: Justin Cohen <>
Commit-Queue: Eugene But <>
Cr-Original-Commit-Position: refs/heads/master@{#627509}(cherry picked from commit 010e2b264abf807d9d24f080816e657d6bbaa2ee)
Reviewed-by: Kariah Davis <>
Cr-Commit-Position: refs/branch-heads/3683@{#94}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
1 file changed