From c6947b2ba6c8469cf239ec0fff069e053f5ecf66 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 17 Jan 2019 14:55:06 +0100 Subject: [PATCH] Note: Make sure extraProperties is always initialized --- lib/note.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/note.dart b/lib/note.dart index 34927a4c..478f8728 100644 --- a/lib/note.dart +++ b/lib/note.dart @@ -11,7 +11,11 @@ class Note implements Comparable { Map extraProperties = new Map(); - Note({this.created, this.body, this.id, this.extraProperties}); + Note({this.created, this.body, this.id, this.extraProperties}) { + if (extraProperties == null) { + extraProperties = new Map(); + } + } factory Note.fromJson(Map json) { String id;