1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-09 12:15:45 +01:00

Just explicitly check bookmark node URIs for nullness. How does this even happen?

This commit is contained in:
Kris Maglione
2009-11-08 20:58:43 -05:00
parent 6a25312c7d
commit b117f6749a

View File

@@ -60,20 +60,15 @@ const Bookmarks = Module("bookmarks", {
this.__iterator__ = function () (val for ([, val] in Iterator(self.bookmarks)));
function loadBookmark(node) {
try {
let uri = util.newURI(node.uri);
let keyword = bookmarksService.getKeywordForBookmark(node.itemId);
let tags = tagging.getTagsForURI(uri, {}) || [];
let bmark = new Bookmark(node.uri, node.title, node.icon && node.icon.spec, keyword, tags, node.itemId);
if (node.uri == null) // How does this happen?
return false;
let uri = util.newURI(node.uri);
let keyword = bookmarksService.getKeywordForBookmark(node.itemId);
let tags = tagging.getTagsForURI(uri, {}) || [];
let bmark = new Bookmark(node.uri, node.title, node.icon && node.icon.spec, keyword, tags, node.itemId);
bookmarks.push(bmark);
return bmark;
}
catch (e) {
liberator.dump("Failed to create bookmark for URI: " + node.uri);
liberator.reportError(e);
return null;
}
bookmarks.push(bmark);
return bmark;
}
function readBookmark(id) {