From acc82d850ce6930a99bd2bd5b391e9ded3ded4a2 Mon Sep 17 00:00:00 2001 From: Ed Horsford Date: Tue, 4 Jun 2019 20:15:00 +0100 Subject: [PATCH] Check for empty tags Fixes #556 --- src/TemplateData.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/TemplateData.js b/src/TemplateData.js index 501553aef..84e3acee8 100644 --- a/src/TemplateData.js +++ b/src/TemplateData.js @@ -338,8 +338,13 @@ class TemplateData { } static cleanupData(data) { - if ("tags" in data && typeof data.tags === "string") { - data.tags = data.tags ? [data.tags] : []; + if ("tags" in data){ + if (typeof data.tags === "string"){ + data.tags = data.tags ? [data.tags] : []; + } + if (data.tags === null){ + data.tags = [] + } } return data;