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

Unified Diff: chrome/browser/importer/safari_importer.mm

Issue 164442: Fix early return/DCHECK importing Safari bookmarks. (Closed)
Patch Set: Created 11 years, 4 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/safari_importer.mm
diff --git a/chrome/browser/importer/safari_importer.mm b/chrome/browser/importer/safari_importer.mm
index 0057aef5da9639108fc769619f78ec76315b6bdb..1f839a7f194ecb4ff2dcc02fca73cfec1b0ada3e 100644
--- a/chrome/browser/importer/safari_importer.mm
+++ b/chrome/browser/importer/safari_importer.mm
@@ -179,12 +179,15 @@ void SafariImporter::RecursiveReadBookmarksFolder(
objectForKey:@"WebBookmarkFileVersion"] != nil;
// We're expecting a list of bookmarks here, if that isn't what we got, fail.
- if (![type isEqualToString:@"WebBookmarkTypeList"] || !title) {
- DCHECK(false) << "Type =("
- << (type ? base::SysNSStringToUTF8(type) : "Null Type")
- << ") Title=(" << (title ? base::SysNSStringToUTF8(title) : "Null title")
- << ")";
- return;
+ if (!is_top_level_bookmarks_container) {
+ // Top level containers sometimes don't have title attributes.
+ if (![type isEqualToString:@"WebBookmarkTypeList"] || !title) {
+ DCHECK(false) << "Type =("
+ << (type ? base::SysNSStringToUTF8(type) : "Null Type")
+ << ") Title=(" << (title ? base::SysNSStringToUTF8(title) : "Null title")
+ << ")";
+ return;
+ }
}
std::vector<std::wstring> path_elements(parent_path_elements);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698