Skip to content

Commit

Permalink
Added fallback in case wordcounts are not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
fjwillemsen committed Aug 10, 2022
1 parent b85fa1f commit 889bf89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Scripts/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ function getWordCountChartConfig() {

// get the labels and data
const wordcounts_project = wordcounts[this.project_id];
if (wordcounts == undefined || wordcounts.size() <= 0) {
alert("Wordcounts have not been tracked, enable wordcount tracking and reload the project");
}
for (const [date, wordcount] of Object.entries(wordcounts_project)) {
labels.push(date);
const count =
Expand Down
Loading

0 comments on commit 889bf89

Please sign in to comment.