Skip to content

Commit

Permalink
replace missing parent field with parent: null
Browse files Browse the repository at this point in the history
  • Loading branch information
chocolateboy committed Sep 24, 2018
1 parent cf530c9 commit 89e0e87
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ function wrapGetTemplate (env, dependencies) {
const originalCallback = cb
const wrapper = (err, result) => {
if (!err) {
dependencies.push({ name, parent, path: result.path })
dependencies.push({
name,
parent: parent || null,
path: result.path,
})
}

return originalCallback(err, result)
Expand All @@ -57,7 +61,11 @@ function wrapGetTemplate (env, dependencies) {
const result = oldGetTemplate.apply(this, args)

if (!cb) {
dependencies.push({ name, parent, path: result.path })
dependencies.push({
name,
parent: parent || null,
path: result.path,
})
}

return result
Expand Down

0 comments on commit 89e0e87

Please sign in to comment.