From dfd5d6f6d2a2f5cab35f7584ea3200febb4e2485 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Wed, 23 Jan 2019 12:08:06 +0100 Subject: [PATCH] Note: Remove the asserts We actually do quite often create notes without anything, and then later fill them up. Lets just setup a bad default for the created. --- lib/note.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/note.dart b/lib/note.dart index 36c41ecd..35821da6 100644 --- a/lib/note.dart +++ b/lib/note.dart @@ -12,10 +12,9 @@ class Note implements Comparable { Map extraProperties = new Map(); Note({this.created, this.body, this.fileName, this.extraProperties}) { - assert(this.created != null); - assert(this.body != null); - assert(this.fileName != null); - + if (created == null) { + created = DateTime(0, 0, 0, 0, 0, 0, 0, 0); + } if (extraProperties == null) { extraProperties = new Map(); }