rem: var oldCalendar = getCalendar(); 
add: var oldCalendar = getDefaultCalendar(); 
context: function publishEntireCalendarDialogResponse( CalendarPublishObject ){    var icsURL = makeURL(CalendarPublishObject.remotePath);    var oldCalendar = getCalendar(); // get the currently selected calendar    // create an ICS calendar, but don't register it    var calManager = getCalendarManager();    try {        var newCalendar = calManager.createCalendar(oldCalendar.name, "ics", icsURL);    } catch (ex) {        dump(ex);        return false;    }    var getListener = {        onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail)        {            // delete the new calendar now that we're done with it            calManager.deleteCalendar(newCalendar);        }    };    appendCalendars(newCalendar, [oldCalendar], getListener);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/efb2bd65d59602ada11898e626b3e77f6d397006/calendar.js/buggy/calendar/resources/content/calendar.js