From ed93b8dce89118e74e0377af5d9681c138813e9e Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Mon, 23 Dec 2019 09:13:40 -0500 Subject: [PATCH] [+] Check null cases --- src/App.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/App.vue b/src/App.vue index b95df5f..e929943 100644 --- a/src/App.vue +++ b/src/App.vue @@ -64,6 +64,12 @@ // Parse artworks config.artworks.forEach(a => { + // Check null case + if (a.date == null) Error('Error: No date specified.'); + if (a.title == null) a.title = config.artwork.default_title; + if (a.format == null) a.format = config.artwork.default_format; + + // Add it this.artworks.push(new Artwork(a.date, a.title, a.format)); }) }