From 0fc40da55bd0b146e26e07183ad2632fd72746ee Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Mon, 2 Mar 2020 19:56:13 +0100 Subject: [PATCH] JournalEditor: Avoid crashing if note has no creation date In the future when we improve the git itegration that will never happen, but for now, it's what we have. --- lib/widgets/journal_editor_header.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/widgets/journal_editor_header.dart b/lib/widgets/journal_editor_header.dart index a3baee4e..9db8299d 100644 --- a/lib/widgets/journal_editor_header.dart +++ b/lib/widgets/journal_editor_header.dart @@ -9,6 +9,9 @@ class JournalEditorHeader extends StatelessWidget { @override Widget build(BuildContext context) { + if (note.created == null) { + return Container(); + } var dateStr = DateFormat('MMMM, yyyy').format(note.created); var timeStr = DateFormat('EEEE HH:mm').format(note.created);