If we can't create a calendar instance, perhaps because of a bogus id or uri,

just skip the calendar in question, rather than failing to get any calendars.
(Still to do: figure out exactly how we get into this state in the current
code.) NPOTB.
This commit is contained in:
shaver%mozilla.org 2005-04-25 12:59:52 +00:00
parent 4681a7723b
commit 2d5ba6cf4e

View File

@ -203,7 +203,13 @@ calCalendarManager.prototype = {
while (stmt.step()) {
var id = stmt.row.id;
if (!this.mCache[id]) {
this.mCache[id] = this.createCalendar(stmt.row.name, stmt.row.type, makeURI(stmt.row.uri));
try {
this.mCache[id] = this.createCalendar(stmt.row.name, stmt.row.type, makeURI(stmt.row.uri));
} catch (e) {
dump("Can't create calendar for " + id + " (" + stmt.row.name + ", " + stmt.row.type + ", " +
stmt.row.uri + "): " + e.toString + "\n");
continue;
}
}
calendars.push(this.mCache[id]);
}