Bug 806460 - Part 2: more nuanced rejection of malformed records. r=me (fix bustage).

This commit is contained in:
Richard Newman 2012-10-29 17:47:04 -07:00
Родитель e78c3da7ed
Коммит d29f11cef0
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -434,7 +434,7 @@ BookmarksStore.prototype = {
preprocessTagQuery: function preprocessTagQuery(record) {
if (record.type != "query" ||
record.bmkUri == null ||
record.folderName == null)
!record.folderName)
return;
// Yes, this works without chopping off the "place:" prefix.
@ -501,8 +501,7 @@ BookmarksStore.prototype = {
// Skip malformed records. (Bug 806460.)
if (record.type == "query" &&
(!record.bmkUri ||
!record.folderName)) {
!record.bmkUri) {
this._log.warn("Skipping malformed query bookmark: " + record.id);
return;
}

Просмотреть файл

@ -393,8 +393,12 @@ add_test(function test_empty_query_doesnt_die() {
record.parentName = "Toolbar";
record.parentid = "toolbar";
// This should not throw.
// These should not throw.
store.applyIncoming(record);
delete record.folderName;
store.applyIncoming(record);
run_next_test();
});