Skip to content

Commit

Permalink
fix: crash on invalid JSDoc class comment (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinovyatkin authored and gajus committed Dec 8, 2018
1 parent 5bd0fb7 commit 9a38896
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/iterateJsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ const curryUtils = (

if (greatGrandParentValue === 'class') {
const classJsdocNode = sourceCode.getJSDocComment(greatGrandParent);
const indent = _.repeat(' ', classJsdocNode.loc.start.column);
const classJsdoc = parseComment(classJsdocNode, indent);

if (jsdocUtils.hasTag(classJsdoc, tagName)) {
return true;
if (classJsdocNode) {
const indent = _.repeat(' ', classJsdocNode.loc.start.column);
const classJsdoc = parseComment(classJsdocNode, indent);

if (jsdocUtils.hasTag(classJsdoc, tagName)) {
return true;
}
}
}

Expand Down

0 comments on commit 9a38896

Please sign in to comment.