Skip to content

Commit

Permalink
fix: check if scanned project does have a callgraph
Browse files Browse the repository at this point in the history
When running with `snyk test --reachable --all-projects`
and one of the projects is not supported for reachable vulns
i.e. not maven, we are failing.

This change makes sure that the project does have a
call graph.
  • Loading branch information
Dar Malovani committed Aug 25, 2020
1 parent 812dc4d commit 2d11938
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/snyk-test/run-test.ts
Expand Up @@ -533,10 +533,7 @@ async function assembleLocalPayloads(
body.depGraph = depGraph;
}

if (
options.reachableVulns &&
(scannedProject.callGraph as CallGraphError).message
) {
if (options.reachableVulns && scannedProject.callGraph?.message) {
const err = scannedProject.callGraph as CallGraphError;
const analyticsError = err.innerError || err;
analytics.add('callGraphError', {
Expand Down

0 comments on commit 2d11938

Please sign in to comment.