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.
This commit is contained in:
Vishesh Handa
2020-09-22 12:17:06 +02:00
parent 296e4de7b5
commit acce7160b9

View File

@ -98,6 +98,9 @@ Future<Note> 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;