Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 1258193 - Check undefined variables to workaround disappearing calendar events #34424

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/calendar/js/day_observer.js
Expand Up @@ -138,7 +138,7 @@ exports.removeAllListeners = function() {
// cache data and show the event details faster on the most common cases
exports.findAssociated = function(busytimeId) {
return queryBusytime(busytimeId).then(busytime => {
return queryEvent(busytime.eventId).then(event => {
if (typeof busytime !== 'undefined') return queryEvent(busytime.eventId).then(event => {
return {
busytime: busytime,
event: event
Expand Down Expand Up @@ -172,7 +172,7 @@ function cacheBusytime(busy) {
}

busytimes.set(_id, busy);
eventsToBusytimes.get(eventId).push(_id);
if (typeof eventsToBusytimes.get(eventId) !== 'undefined') eventsToBusytimes.get(eventId).push(_id);
registerBusytimeChange(_id);
}

Expand Down Expand Up @@ -262,7 +262,7 @@ function sortedInsert(group, busy) {
});
var event = events.get(busy.eventId);
var calendarStore = core.storeFactory.get('Calendar');
group.splice(index, 0, {
if (typeof event !== 'undefined') group.splice(index, 0, {
event: event,
busytime: busy,
color: calendarStore.getColorByCalendarId(event.calendarId)
Expand Down