From 34036eb224ff1b87f909af20b89321af052113c1 Mon Sep 17 00:00:00 2001 From: Antoine Pultier Date: Mon, 25 Jun 2018 13:55:31 +0200 Subject: [PATCH] Fix #507 --- rules/avoid-scope-typos.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/avoid-scope-typos.js b/rules/avoid-scope-typos.js index 634523ba..46d8b211 100644 --- a/rules/avoid-scope-typos.js +++ b/rules/avoid-scope-typos.js @@ -24,7 +24,7 @@ module.exports = { }, create: function(context) { function check(node, name) { - if (bad.indexOf(name) >= 0 && scope.indexOf(node.parent.object.name) >= 0) { + if (bad.indexOf(name) >= 0 && node && node.parent && node.parent.object && scope.indexOf(node.parent.object.name) >= 0) { context.report(node, `The ${name} method should be replaced by $${name}, or you should rename it in order to avoid confusions`, {}); } }