Closed Bug 329571 Opened 18 years ago Closed 18 years ago

Error when setting composite calendar's default calendar with usePref==true


(Calendar :: Internal Components, defect)

Not set


(Not tracked)



(Reporter: jminta, Assigned: jminta)



(1 file)

When setting the composite calendar's default calendar, it does not check first to ensure that mDefaultCalendar is non-null.  This eventually throws an error in findCalendarID in calCalendarManager.js of "calendar has no properties".

It's difficult to reproduce this error in Thunderbird.  I suspect it would only happen if someone used some trickery to get Lightning to open in 2 separate windows.  Therefore, I'm not recommending this fix for 0.1.

Relevant line:
Patch moves the deletePref call into an if block, so it will only be called if the calendar exists.
Assignee: base → jminta
Attachment #214260 - Flags: first-review?(dmose)
(In reply to comment #0)
> It's difficult to reproduce this error in Thunderbird.

The exception in findCalendarID happens in Thunderbird 1.5 too. Just right click any mail folder and select 'open in new window'. Then switch to calendar view in both windows and start playing around.
Comment on attachment 214260 [details] [diff] [review]
check for null first

r=dmose.  One thing that's not clear to me, though, is what the "default calendar" semantics of having two windows open is.  My suspicion is that changing the default calendar in one window will forcibly change the default calendar in the other (as a side being effect of the same pref watched by both windows changing).  This doesn't strike me as particularly intuitive behavior.  Can you test this and see what the semantics are here, and file another bug to deal with clarifying them?
Attachment #214260 - Flags: first-review?(dmose) → first-review+
Patch checked in and bug 332401 filed.
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.