Fix error when parsing empty yml file

This commit is contained in:
Jinksi 2017-11-25 15:12:48 +10:00
parent 864bb1d3c5
commit 391effcfa8

View file

@ -42,12 +42,8 @@ const parseMarkdown = data => {
} }
const parseYaml = data => { const parseYaml = data => {
try { data = yaml.safeLoad(data, 'utf8') || {}
data = yaml.safeLoad(data, 'utf8') return JSON.stringify(data)
return JSON.stringify(data)
} catch (e) {
return console.log(e)
}
} }
const getFileContents = filePath => { const getFileContents = filePath => {