From 9465b1ad62ef346bd38e6753050886a3072d03cc Mon Sep 17 00:00:00 2001 From: Jason Luong Date: Mon, 16 Oct 2023 17:43:27 +0100 Subject: [PATCH] fix: type error after minor update --- .../services/vulnerabilityCount/parsers/babelParser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/snyk/snykOss/services/vulnerabilityCount/parsers/babelParser.ts b/src/snyk/snykOss/services/vulnerabilityCount/parsers/babelParser.ts index c3ca96d01..e898fbb78 100644 --- a/src/snyk/snykOss/services/vulnerabilityCount/parsers/babelParser.ts +++ b/src/snyk/snykOss/services/vulnerabilityCount/parsers/babelParser.ts @@ -53,13 +53,13 @@ export class BabelParser extends ModuleParser { fileName, name: BabelParser.getModuleName(node), line: node.loc ? node.loc.end.line : null, - loc: node.arguments[0].loc, + loc: node.arguments[0].loc ? node.arguments[0].loc : null, string: BabelParser.compileRequireString(node), }); } else if (node.callee.type === 'Import') { modules.push({ fileName, - loc: node.arguments[0].loc, + loc: node.arguments[0].loc ? node.arguments[0].loc : null, name: BabelParser.getModuleName(node), line: node.loc ? node.loc.end.line : null, string: BabelParser.compileImportExpressionString(node),