Skip to content

Commit 7d43363

Browse files
committed
add node undefined check
1 parent b6e4c6a commit 7d43363

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rules/require-default-props.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ module.exports = {
330330
}
331331

332332
function hasPropTypesAsGeneric(node) {
333-
return node.parent && node.parent.type === 'ClassDeclaration';
333+
return node && node.parent && node.parent.type === 'ClassDeclaration';
334334
}
335335

336336
function handlePropTypesAsGeneric(node) {

0 commit comments

Comments
 (0)