Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: components/offline_pages/offline_page_model.cc

Issue 1473043002: [Offline pages] Fixing a crash in URL change, when offline copy not present (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding tests for 2 crashing bugs Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/offline_page_model.cc
diff --git a/components/offline_pages/offline_page_model.cc b/components/offline_pages/offline_page_model.cc
index 26de71682ce1e198c734f2a4ddf91eb79dd7c6a2..98ff1c8728e4e8158d0d3ff7372a991d951e737f 100644
--- a/components/offline_pages/offline_page_model.cc
+++ b/components/offline_pages/offline_page_model.cc
@@ -477,8 +477,8 @@ void OfflinePageModel::BookmarkNodeChanged(
const bookmarks::BookmarkNode* node) {
// BookmarkNodeChanged could be triggered if title or URL gets changed. If
// the latter, we need to invalidate the offline copy.
- DCHECK(offline_pages_.count(node->id()) > 0);
- if (offline_pages_[node->id()].url != node->url())
+ auto iter = offline_pages_.find(node->id());
+ if (iter != offline_pages_.end() && iter->second.url != node->url())
DeletePageByBookmarkId(node->id(), DeletePageCallback());
}
« no previous file with comments | « components/offline_pages/offline_page_model.h ('k') | components/offline_pages/offline_page_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698