Fix "vevent" KeyError in caldav component (#61718)

pull/62217/head
jkuettner 2021-12-17 16:54:19 +01:00 committed by GitHub
parent a9fc750fe3
commit 3b97c544b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -161,6 +161,9 @@ class WebDavCalendarData:
)
event_list = []
for event in vevent_list:
if not hasattr(event.instance, "vevent"):
_LOGGER.warning("Skipped event with missing 'vevent' property")
continue
vevent = event.instance.vevent
if not self.is_matching(vevent, self.search):
continue
@ -198,6 +201,9 @@ class WebDavCalendarData:
# and they would not be properly parsed using their original start/end dates.
new_events = []
for event in results:
if not hasattr(event.instance, "vevent"):
_LOGGER.warning("Skipped event with missing 'vevent' property")
continue
vevent = event.instance.vevent
for start_dt in vevent.getrruleset() or []:
_start_of_today = start_of_today