diff --git a/lib/util/Components.js b/lib/util/Components.js index 515a39dd00..96b149d78b 100644 --- a/lib/util/Components.js +++ b/lib/util/Components.js @@ -483,7 +483,9 @@ function componentRule(rule, context) { } if (body.type === 'BlockStatement') { const jsxElement = body.body.find(item => item.type === 'ReturnStatement'); - return jsxElement && this.getComponentNameFromJSXElement(jsxElement.argument); + return jsxElement && + jsxElement.argument && + this.getComponentNameFromJSXElement(jsxElement.argument); } return null; },