Skip to content

Commit

Permalink
fix null pointer exception (#717) (#797)
Browse files Browse the repository at this point in the history
ignore deep CJS imports/exports
  • Loading branch information
benmosher committed May 18, 2017
1 parent 0fb592e commit 2efc41a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ExportMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,14 @@ export default class ExportMap {
callback.call(thisArg, reexported && reexported.get(reexports.local), name, this)
})

this.dependencies.forEach(dep => dep().forEach((v, n) =>
n !== 'default' && callback.call(thisArg, v, n, this)))
this.dependencies.forEach(dep => {
const d = dep()
// CJS / ignored dependencies won't exist (#717)
if (d == null) return

d.forEach((v, n) =>
n !== 'default' && callback.call(thisArg, v, n, this))
})
}

// todo: keys, values, entries?
Expand Down

0 comments on commit 2efc41a

Please sign in to comment.