From 1a065353d5f59ff430f9a311e46401c5ea223fd2 Mon Sep 17 00:00:00 2001 From: Philip Nilsson Date: Fri, 16 Feb 2018 23:44:59 +0100 Subject: [PATCH] Add null check 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. --- src/babel.dev.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/babel.dev.js b/src/babel.dev.js index b17797fa9..b89f085ad 100644 --- a/src/babel.dev.js +++ b/src/babel.dev.js @@ -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.