зеркало из https://github.com/mozilla/gecko-dev.git
Bug 622657 - catch invalid bookmark items and delete them when syncing bookmarks. r=rnewman
This commit is contained in:
Родитель
8f91295fc2
Коммит
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче