diff --git a/src/eslint/getJSDocComment.js b/src/eslint/getJSDocComment.js index 8dbeeaf6d..c8641aaf4 100644 --- a/src/eslint/getJSDocComment.js +++ b/src/eslint/getJSDocComment.js @@ -24,10 +24,7 @@ const getDecorator = (token, sourceCode) => { do { tokenBefore = sourceCode.getTokenBefore(tokenBefore, {includeComments: true}); // istanbul ignore if - if (!tokenBefore) { - break; - } - if (tokenBefore.type === 'Punctuator') { + if (tokenBefore && tokenBefore.type === 'Punctuator') { if (tokenBefore.value === ')') { nested++; }