Fix for empty page contents crashing parser

This commit is contained in:
NGPixel
2017-04-06 20:55:45 -04:00
parent d7a9b95850
commit 956d3aca08
3 changed files with 21 additions and 6 deletions
+4
View File
@@ -173,6 +173,10 @@ const parseContent = (content) => {
let output = mkdown.render(content)
let cr = cheerio.load(output)
if (cr.root().children().length < 1) {
return ''
}
// -> Check for empty first element
let firstElm = cr.root().children().first()[0]