diff --git a/scripts/renderer.js b/scripts/renderer.js index 28e5079..9dbef15 100644 --- a/scripts/renderer.js +++ b/scripts/renderer.js @@ -15,7 +15,10 @@ function njkCompile(data) { return dictionary; }); env.addFilter('json', dictionary => { - return JSON.stringify(dictionary || ''); + if (typeof dictionary !== 'undefined' && dictionary !== null) { + return JSON.stringify(dictionary); + } + return '""'; }); return nunjucks.compile(data.text, env, data.path); }