Skip to content

Commit

Permalink
fix: skip format data.head if not exist while loading toml config (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsupu authored and ulivz committed Aug 8, 2018
1 parent 2e8d69c commit bb48a77
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/prepare/loadConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ function parseConfig (file) {
// reformat to match config since TOML does not allow different data type
// https://github.com/toml-lang/toml#array
const format = []
Object.keys(data.head).forEach(meta => {
data.head[meta].forEach(values => {
format.push([meta, values])
if (data.head) {
Object.keys(data.head).forEach(meta => {
data.head[meta].forEach(values => {
format.push([meta, values])
})
})
})
}
data.head = format
break
}
Expand Down

0 comments on commit bb48a77

Please sign in to comment.