Skip to content

Commit

Permalink
add node undefined check
Browse files Browse the repository at this point in the history
  • Loading branch information
pmizio committed Mar 28, 2018
1 parent b6e4c6a commit 7d43363
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/require-default-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ module.exports = {
}

function hasPropTypesAsGeneric(node) {
return node.parent && node.parent.type === 'ClassDeclaration';
return node && node.parent && node.parent.type === 'ClassDeclaration';
}

function handlePropTypesAsGeneric(node) {
Expand Down

0 comments on commit 7d43363

Please sign in to comment.