From a2e081e4edeb09584bc3be88278dd497eaae70f9 Mon Sep 17 00:00:00 2001 From: Tom Vincent Date: Wed, 4 Nov 2015 17:40:53 +0000 Subject: [PATCH] fix(prohibit): check name property exists Closes #21. --- lib/prohibit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prohibit.js b/lib/prohibit.js index 4d928aa..15345bf 100644 --- a/lib/prohibit.js +++ b/lib/prohibit.js @@ -5,7 +5,7 @@ module.exports = function (prohibiteds, context) { return { 'CallExpression': function (node) { - var result = node.callee && node.callee.name.match(regex) + var result = node.callee && node.callee.name && node.callee.name.match(regex) if (result) { context.report(node, 'Unexpected {{name}}.', {