diff --git a/library/calendar_sync.py b/library/calendar_sync.py index 09850ad..12e003e 100644 --- a/library/calendar_sync.py +++ b/library/calendar_sync.py @@ -53,10 +53,12 @@ def sync_ics_to_caldav(module): existing_events = {} for event in target_cal.events(): + if not event or not event.data: + continue try: for calendar in vobject.readComponents(event.data): for component in calendar.components(): - if component.name == 'VEVENT': + if component.name == 'VEVENT' and hasattr(component, "uid"): uid = str(component.uid) existing_events[uid] = event except Exception as e: @@ -110,4 +112,3 @@ def run_module(): if __name__ == '__main__': run_module() -