Skip to content

Commit

Permalink
Add null check
Browse files Browse the repository at this point in the history
I'm encountering an error in `babel.dev.js/exit`. It's in quite a large project, and I don't have time to figure out the reason. (It fails checking a dependency called `js-csp`). Hoping you'll consider adding this extra check.
  • Loading branch information
philipnilsson authored Feb 16, 2018
1 parent 8fa1d42 commit 1a06535
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/babel.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ module.exports = function plugin(args) {
node[REGISTRATIONS] = null // eslint-disable-line no-param-reassign

// inject the code only if applicable
if (registrations.length) {
if (registrations && registrations.length) {
node.body.unshift(headerTemplate())
// Inject the generated tagging code at the very end
// so that it is as minimally intrusive as possible.
Expand Down

0 comments on commit 1a06535

Please sign in to comment.