Skip to content

Commit

Permalink
Fix issue with new keyword in object
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob-Thomas committed Jul 11, 2018
1 parent 7e536b2 commit 0e2aff7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rules/avoid-scope-typos.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 && 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`, {});
}
}
Expand Down

0 comments on commit 0e2aff7

Please sign in to comment.