mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 03:05:34 +00:00
bug 436696: make sure we pass a valid URI to nsITaggingService::getTagsForURI when the bookmark record doesn't include a URI so the method doesn't throw and hork bookmarks sync
This commit is contained in:
parent
7b5ca70bb5
commit
4041662e5a
@ -558,7 +558,24 @@ BookmarksStore.prototype = {
|
||||
}
|
||||
|
||||
item.URI = node.uri;
|
||||
item.tags = this._ts.getTagsForURI(Utils.makeURI(node.uri), {});
|
||||
|
||||
// This will throw if makeURI can't make an nsIURI object out of the
|
||||
// node.uri string (or return null if node.uri is null), in which case
|
||||
// we won't be able to get tags for the bookmark (but we'll still sync
|
||||
// the rest of the record).
|
||||
let uri;
|
||||
try {
|
||||
uri = Utils.makeURI(node.uri);
|
||||
}
|
||||
catch(e) {
|
||||
this._log.error("error parsing URI string <" + node.uri + "> " +
|
||||
"for item " + node.itemId + " (" + node.title + "): " +
|
||||
e);
|
||||
}
|
||||
|
||||
if (uri)
|
||||
item.tags = this._ts.getTagsForURI(uri, {});
|
||||
|
||||
item.keyword = this._bms.getKeywordForBookmark(node.itemId);
|
||||
|
||||
} else if (node.type == node.RESULT_TYPE_SEPARATOR) {
|
||||
|
Loading…
Reference in New Issue
Block a user