Bug 506297 - Livemarks with null site/feed uris cause sync to fail

It's possible for livemarks to not have a siteURI, so don't assume it to be there.

--HG--
extra : rebase_source : 870bb41c980834ef3e5f302739d20adfed6f7f8d
This commit is contained in:
Edward Lee 2009-08-26 14:22:11 -07:00
Родитель 2ee5449f03
Коммит 1996dc0246
1 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -365,9 +365,12 @@ BookmarksStore.prototype = {
record._insertPos, "as", record.title].join(" "));
break;
case "livemark":
newId = this._ls.createLivemark(record._parent, record.title,
Utils.makeURI(record.siteUri), Utils.makeURI(record.feedUri),
record._insertPos);
let siteURI = null;
if (record.siteUri != null)
siteURI = Utils.makeURI(record.siteUri);
newId = this._ls.createLivemark(record._parent, record.title, siteURI,
Utils.makeURI(record.feedUri), record._insertPos);
this._log.debug(["created livemark", newId, "under", record._parent, "at",
record._insertPos, "as", record.title, record.siteUri, record.feedUri].
join(" "));
@ -621,7 +624,10 @@ BookmarksStore.prototype = {
case this._bms.TYPE_FOLDER:
if (this._ls.isLivemark(placeId)) {
record = new Livemark();
record.siteUri = this._ls.getSiteURI(placeId).spec;
let siteURI = this._ls.getSiteURI(placeId);
if (siteURI != null)
record.siteUri = siteURI.spec;
record.feedUri = this._ls.getFeedURI(placeId).spec;
} else {