From 514c64619ab096dfdadd2192e565ed0c683e19c2 Mon Sep 17 00:00:00 2001 From: Steven Rollason <2099542+gadgetchnnel@users.noreply.github.com> Date: Tue, 26 May 2020 15:39:53 +0100 Subject: [PATCH] Check todoist due date is not None in async_get_events (#36140) * Check that due date is not None Check that due date is not None, prevents taks without due dates from breaking Calendar API * Invert None check to reduce indentation --- homeassistant/components/todoist/calendar.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/todoist/calendar.py b/homeassistant/components/todoist/calendar.py index fd246520696..0ce8101f49c 100644 --- a/homeassistant/components/todoist/calendar.py +++ b/homeassistant/components/todoist/calendar.py @@ -500,6 +500,8 @@ class TodoistProjectData: events = [] for task in project_task_data: + if task["due"] is None: + continue due_date = _parse_due_date(task["due"]) if start_date < due_date < end_date: event = {