[Nav Experiment] Fix crash when WKWebView is removed from nav manager.
CRWWebController removes WKWebView when the web process is evicted (crbug/815248). This leaves WKBasedNavigationManager in an inconsistent state as previous_item_index_ may not be -1, but GetItemCount() is 0. This causes a crash in OnNavigationItemCommitted() when user starts a new navigation by typing into the omnibox. Fix the crash by guarding the pointer dereference with a nullptr check. Bug: 797756 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs Change-Id: Ie553efbe7bb558a8af955ca6f64e2b8aea58aacd Reviewed-on: https://chromium-review.googlesource.com/996436Reviewed-by:Eugene But <eugenebut@chromium.org> Commit-Queue: Danyao Wang <danyao@chromium.org> Cr-Commit-Position: refs/heads/master@{#548250}
Showing
Please register or sign in to comment