Bug 347113 Unsubscribing from a calendar causes a js error. patch by Lukas Ramach <ramach@utanet.at>, r=jminta

This commit is contained in:
jminta%gmail.com 2006-08-08 16:55:17 +00:00
Родитель e305ad4abb
Коммит 09a4a58d97
1 изменённых файлов: 7 добавлений и 3 удалений

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

@ -224,15 +224,19 @@ calCompositeCalendar.prototype = {
},
setDefaultCalendar: function (cal, usePref) {
if (this.mDefaultCalendar && this.mDefaultCalendar.uri.equals(cal.uri))
// don't do anything if the passed calendar is the default calendar!
if (this.mDefaultCalendar && cal && this.mDefaultCalendar.uri.equals(cal.uri))
return;
if (usePref && this.mPrefPrefix) {
if (this.mDefaultCalendar) {
getCalendarManager().deleteCalendarPref(this.mDefaultCalendar,
this.mDefaultPref);
}
getCalendarManager().setCalendarPref(cal, this.mDefaultPref,
"true");
// if not null set the new calendar as default in the preferences
if (cal) {
getCalendarManager().setCalendarPref(cal, this.mDefaultPref,
"true");
}
}
this.mDefaultCalendar = cal;
this.notifyObservers("onDefaultCalendarChanged", [cal]);