Index: chrome/browser/ui/webui/interstitials/interstitial_ui.cc |
diff --git a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc |
index 5185dacb1c3339358b9932793521ffbc6a0a4946..0f6e454d4d7f26c7f133632fbb5556e90525aaef 100644 |
--- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc |
+++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc |
@@ -343,6 +343,11 @@ void InterstitialHTMLSource::StartDataRequest( |
const content::ResourceRequestInfo::WebContentsGetter& wc_getter, |
const content::URLDataSource::GotDataCallback& callback) { |
content::WebContents* web_contents = wc_getter.Run(); |
+ if (!web_contents) { |
+ // When browser-side navigation is enabled, web_contents can be null if |
+ // the tab is closing. Nothing to do in this case. |
+ return; |
+ } |
std::unique_ptr<content::InterstitialPageDelegate> interstitial_delegate; |
if (base::StartsWith(path, "ssl", base::CompareCase::SENSITIVE)) { |
interstitial_delegate.reset(CreateSSLBlockingPage(web_contents)); |