Skip to content

Commit 94133a0

Browse files
committed
Merge pull request jsx-eslint#193 from mattyod/fix/check-index-is-not-negative
Fix crash on propTypes declarations with an empty body
2 parents 7119df9 + 8dc1053 commit 94133a0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/rules/prop-types.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,9 @@ module.exports = function(context) {
580580
}
581581
}
582582

583-
markPropTypesAsDeclared(node, node.value.body.body[i].argument);
583+
if (i >= 0) {
584+
markPropTypesAsDeclared(node, node.value.body.body[i].argument);
585+
}
584586
},
585587

586588
ObjectExpression: function(node) {

0 commit comments

Comments
 (0)