From 8dc1053aab549d8c9d39d25072be0715428646a6 Mon Sep 17 00:00:00 2001 From: mattyod Date: Thu, 20 Aug 2015 14:57:38 +0100 Subject: [PATCH] Check index is not negative. --- lib/rules/prop-types.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rules/prop-types.js b/lib/rules/prop-types.js index ec909f2792..b4d77ddc3f 100644 --- a/lib/rules/prop-types.js +++ b/lib/rules/prop-types.js @@ -580,7 +580,9 @@ module.exports = function(context) { } } - markPropTypesAsDeclared(node, node.value.body.body[i].argument); + if (i >= 0) { + markPropTypesAsDeclared(node, node.value.body.body[i].argument); + } }, ObjectExpression: function(node) {