Fix very benign bug causing an error to appear in the console instead of nothing happening on page refresh for articles without comments

This commit is contained in:
Tissevert 2019-02-19 19:01:51 +01:00
parent 1d348220fa
commit cf1c93fd1e

View file

@ -29,7 +29,7 @@ function DomRenderer(modules) {
if(text != undefined) { if(text != undefined) {
article.replaceChild(getDiv(text.innerText), text); article.replaceChild(getDiv(text.innerText), text);
if(key != undefined) { if(key != undefined) {
article.appendChild(modules.comments.get(key)[0]); modules.comments.get(key).forEach(article.appendChild.bind(article));
} }
} else { } else {
console.log('No content found for this article'); console.log('No content found for this article');