Fix crash when no due date was present
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
kolaente 2020-04-27 17:18:50 +02:00
parent e110a4b9eb
commit 413c2703e6
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 3 additions and 1 deletions

View File

@ -27,7 +27,9 @@ class Task {
reminders = (json['reminderDates'] as List<dynamic>)
?.map((r) => DateTime.parse(r))
?.toList(),
due = DateTime.parse(json['dueDate']),
due = json['dueDate'].toString() == 'null'
? null
: DateTime.parse(json['dueDate']),
description = json['description'],
text = json['text'],
done = json['done'],