Skip to content

Commit

Permalink
Fix null tags (jamestagal#29).
Browse files Browse the repository at this point in the history
  • Loading branch information
jimafisk committed Jun 30, 2022
1 parent 849d2a9 commit 5b5528d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions themes/compendium/layouts/scripts/catgs_tags.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
let obj = {
name: tagContent[index].fields.name,
path: tagContent[index].path,
posts: Object.values(tagsObj[tagContent[index].fields.name]),
length: Object.keys(tagsObj[tagContent[index].fields.name]).length,
posts: tagsObj[tagContent[index].fields.name] ? Object.values(tagsObj[tagContent[index].fields.name]) : null,
length: tagsObj[tagContent[index].fields.name] ? Object.keys(tagsObj[tagContent[index].fields.name]).length : null,
};
tagsList.push(obj);
}
Expand All @@ -67,8 +67,8 @@
let obj = {
name: catContent[index].fields.name,
path: catContent[index].path,
posts: Object.values(catgObj[catContent[index].fields.name]),
length: Object.keys(catgObj[catContent[index].fields.name]).length,
posts: catgObj[catContent[index].fields.name] ? Object.values(catgObj[catContent[index].fields.name]) : null,
length: catgObj[catContent[index].fields.name] ? Object.keys(catgObj[catContent[index].fields.name]).length : null,
};
catgList.push(obj);
}
Expand Down

0 comments on commit 5b5528d

Please sign in to comment.