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
parent 8f9d0d0717
commit c728d84af7
2 changed files with 7 additions and 4 deletions

View File

@ -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;
}

View File

@ -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();
});