diff --git a/hosts/www/caldav-export.py b/hosts/www/caldav-export.py index bb8f445..295e3b3 100644 --- a/hosts/www/caldav-export.py +++ b/hosts/www/caldav-export.py @@ -45,7 +45,18 @@ def export_calendar(url: str, username: str, password: str, calendar: str) -> Ca print(f" {len(objects)} objects") for obj in objects: - cal = Calendar.from_ical(obj.data) + data = obj.data + + if data is None: + print(f" fetching {obj.url}") + obj.load() + data = obj.data + + if not data: + print(f" skipping empty object {obj.url}") + continue + + cal = Calendar.from_ical(data) for component in cal.walk(): if component.name != "VCALENDAR":