Skip to content

Commit

Permalink
fix crash in jsx-key
Browse files Browse the repository at this point in the history
fix this crash:
´´´
TypeError: Cannot read property 'type' of null
    at checkIteratorElement (/Users/nuno/cp/james/node_modules/eslint-plugin-react/lib/rules/jsx-key.js:25:13)
    at EventEmitter.CallExpression (/Users/nuno/cp/james/node_modules/eslint-plugin-react/lib/rules/jsx-key.js:65:13)
´´´
  • Loading branch information
Nuno Campos committed Jan 1, 2016
1 parent 119bf24 commit c209c28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/jsx-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = function(context) {
if (isFn || isArrFn) {
if (fn.body.type === 'BlockStatement') {
var returnStatement = getReturnStatement(fn.body.body);
if (returnStatement) {
if (returnStatement && returnStatement.argument) {
checkIteratorElement(returnStatement.argument);
}
}
Expand Down

0 comments on commit c209c28

Please sign in to comment.