Skip to content

Commit 8dc1053

Browse files
committed
Check index is not negative.
1 parent 7119df9 commit 8dc1053

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)