Skip to content

Commit de6f79c

Browse files
committed
Merge pull request #377 from nfcampos/patch-1
Fix crash in forbid-prop-types
2 parents 4cb2e9e + c502d72 commit de6f79c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rules/forbid-prop-types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = function(context) {
3333
// (babel-eslint does not expose property name so we have to rely on tokens)
3434
if (node.type === 'ClassProperty') {
3535
var tokens = context.getFirstTokens(node, 2);
36-
if (tokens[0].value === 'propTypes' || tokens[1].value === 'propTypes') {
36+
if (tokens[0].value === 'propTypes' || (tokens[1] && tokens[1].value === 'propTypes')) {
3737
return true;
3838
}
3939
return false;

0 commit comments

Comments
 (0)