Commit 087c22ed authored by Dan Harrington's avatar Dan Harrington Committed by Commit Bot

Fix crash in GetPagesToServeURL

It is possible to reach this function in incognito mode, in which case
offline_page_model will be null. Added code to handle this condition instead
of crash.

Bug: 918119
Change-Id: Iddad53677e168c565a20dfc888d1ccb213a54fe7
Reviewed-on: https://chromium-review.googlesource.com/c/1393465Reviewed-by: default avatarJian Li <jianli@chromium.org>
Commit-Queue: Dan H <harringtond@google.com>
Cr-Commit-Position: refs/heads/master@{#619662}
parent 3038d348
...@@ -408,7 +408,11 @@ void GetPagesToServeURL( ...@@ -408,7 +408,11 @@ void GetPagesToServeURL(
OfflinePageModel* offline_page_model = OfflinePageModel* offline_page_model =
OfflinePageModelFactory::GetForBrowserContext( OfflinePageModelFactory::GetForBrowserContext(
web_contents->GetBrowserContext()); web_contents->GetBrowserContext());
DCHECK(offline_page_model); if (!offline_page_model) {
FailedToFindOfflinePage(RequestResult::OFFLINE_PAGE_NOT_FOUND,
network_state, job);
return;
}
offline_page_model->GetPageByOfflineId( offline_page_model->GetPageByOfflineId(
offline_id, base::Bind(&GetPageByOfflineIdDone, url, offline_header, offline_id, base::Bind(&GetPageByOfflineIdDone, url, offline_header,
network_state, web_contents_getter, job)); network_state, web_contents_getter, job));
......
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