Skip to content

Commit

Permalink
fix pointer bug in ExitError detection
Browse files Browse the repository at this point in the history
  • Loading branch information
bhamail committed Apr 20, 2020
1 parent 45be060 commit 2e69ac2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func main() {
}

if err != nil {
if exiterr, ok := err.(*customerrors.ErrorExit); ok {
if exiterr, ok := err.(customerrors.ErrorExit); ok {
os.Exit(exiterr.ExitCode)
} else {
// really don't expect this
Expand All @@ -76,6 +76,7 @@ func doOssi(ossiArgs []string) (err error) {
return
}
if err = processConfig(ossIndexConfig); err != nil {
LogLady.Info("Nancy finished parsing config for OSS Index, vulnerability found")
return
}
LogLady.Info("Nancy finished parsing config for OSS Index")
Expand Down Expand Up @@ -355,6 +356,7 @@ func checkOSSIndex(purls []string, invalidpurls []string, config configuration.C

if count := audit.LogResults(config.Formatter, packageCount, coordinates, invalidCoordinates, config.CveList.Cves); count > 0 {
// return error with number of vulnerable items found
fmt.Printf("Found vuln count: %d\n", count)
return customerrors.ErrorExit{ExitCode: count}
}
return nil
Expand Down

0 comments on commit 2e69ac2

Please sign in to comment.