diff --git a/backend/src/appointment/controller/calendar.py b/backend/src/appointment/controller/calendar.py index 86ae3a9b1..a07985582 100644 --- a/backend/src/appointment/controller/calendar.py +++ b/backend/src/appointment/controller/calendar.py @@ -402,15 +402,21 @@ def list_events(self, start, end): continue vevent = e.vobject_instance.vevent + if not vevent: + continue + + event_components = vevent.components() # Ignore events with missing datetime data - if not vevent or not vevent.dtstart or (not vevent.dtend and not vevent.duration): + if 'dtstart' not in event_components or ( + 'dtend' not in event_components and 'duration' not in event_components + ): continue # Mark tentative events tentative = status == 'tentative' - title = vevent.summary.value if vevent.summary else l10n('event-summary-default') + title = vevent.summary.value if 'summary' in event_components else l10n('event-summary-default') start = vevent.dtstart.value # get_duration grabs either end or duration into a timedelta end = start + e.get_duration()