Skip to content

Commit

Permalink
Check for empty tags
Browse files Browse the repository at this point in the history
Fixes 11ty#556
  • Loading branch information
edwardhorsford authored Jun 4, 2019
1 parent 7b749ee commit acc82d8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/TemplateData.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit acc82d8

Please sign in to comment.