Bug 866638 - Ignore invalid URIs when importing Safari History, r=gavin

--HG--
extra : rebase_source : a7da5851b13ae1bb487ed843342e2c54976318fb
This commit is contained in:
Steven MacLeod 2013-06-25 18:12:23 -04:00
Родитель 4cb8cb57bf
Коммит 00c5b4c4da
1 изменённых файлов: 11 добавлений и 4 удалений

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

@ -212,10 +212,17 @@ History.prototype = {
for (let entry of entries) {
if (entry.has("lastVisitedDate")) {
let visitDate = this._parseCocoaDate(entry.get("lastVisitedDate"));
places.push({ uri: NetUtil.newURI(entry.get("")),
title: entry.get("title"),
visits: [{ transitionType: transType,
visitDate: visitDate }] });
try {
places.push({ uri: NetUtil.newURI(entry.get("")),
title: entry.get("title"),
visits: [{ transitionType: transType,
visitDate: visitDate }] });
}
catch(ex) {
// Safari's History file may contain malformed URIs which
// will be ignored.
Cu.reportError(ex)
}
}
}
if (places.length > 0) {