From acce7160b9e615abcabf9c943521206b0c1b12e7 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 22 Sep 2020 12:17:06 +0200 Subject: [PATCH] getTodayJournalEntry: Not all notes have a 'created' Non Null by default is really needed. I can't wait for these kind of errors to never happen again. --- lib/utils.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/utils.dart b/lib/utils.dart index 3a047bf4..695419b7 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -98,6 +98,9 @@ Future getTodayJournalEntry(NotesFolderFS rootFolder) async { var today = DateTime.now(); var matches = await rootFolder.matchNotes((n) async { var dt = n.created; + if (dt == null) { + return false; + } return dt.year == today.year && dt.month == today.month && dt.day == today.day;