Skip to content

Commit

Permalink
Add check for null in directive-restrict
Browse files Browse the repository at this point in the history
  • Loading branch information
joelchoo committed Nov 24, 2017
1 parent a093afe commit d7418fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rules/directive-restrict.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ module.exports = {
// Try to find an ancestor function used as definition for one of the found directives
context.getAncestors().some(function(ancestor) {
if (isFunctionDeclaration(ancestor)) {
if (!ancestor.id) {
return false;
}

var fnName = ancestor.id.name;

var correspondingDirective = foundDirectives.find(function(directive) {
Expand Down

0 comments on commit d7418fe

Please sign in to comment.