Skip to content

Commit

Permalink
fix: hande potential undefined (abstract class stuff)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jan 27, 2023
1 parent 8e4c3e0 commit 94147bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/no-missing-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const getTokensCount = (parserServices: ParserServices, node?: TSESTree.Node): n
const realNode = parserServices.esTreeNodeToTSNodeMap.get(node);
const checker = parserServices.program.getTypeChecker();

const underlyingNode = checker.getSymbolAtLocation(realNode)?.getDeclarations()[0];
const underlyingNode = checker.getSymbolAtLocation(realNode)?.getDeclarations()?.[0];
// the literal value might not be an array, but it might a reference to an array
if (
underlyingNode &&
Expand Down

0 comments on commit 94147bb

Please sign in to comment.