mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 622657 - catch invalid bookmark items and delete them when syncing bookmarks. r=rnewman
This commit is contained in:
parent
8f91295fc2
commit
3ef5dc624b
@ -247,7 +247,19 @@ BookmarksEngine.prototype = {
|
||||
// Figure out with which key to store the mapping.
|
||||
let key;
|
||||
let id = this._store.idForGUID(guid);
|
||||
switch (PlacesUtils.bookmarks.getItemType(id)) {
|
||||
let itemType;
|
||||
try {
|
||||
itemType = PlacesUtils.bookmarks.getItemType(id);
|
||||
} catch (ex) {
|
||||
this._log.warn("Deleting invalid bookmark record with id", id);
|
||||
try {
|
||||
PlacesUtils.bookmarks.removeItem(id);
|
||||
} catch (ex) {
|
||||
this._log.warn("Failed to delete invalid bookmark", ex);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
switch (itemType) {
|
||||
case PlacesUtils.bookmarks.TYPE_BOOKMARK:
|
||||
|
||||
// Smart bookmarks map to their annotation value.
|
||||
@ -256,7 +268,7 @@ BookmarksEngine.prototype = {
|
||||
queryId = PlacesUtils.annotations.getItemAnnotation(
|
||||
id, SMART_BOOKMARKS_ANNO);
|
||||
} catch(ex) {}
|
||||
|
||||
|
||||
if (queryId)
|
||||
key = "q" + queryId;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user