Skip to content

Commit

Permalink
Merge pull request #321 from interlynk-io/fix/input-crash
Browse files Browse the repository at this point in the history
Prevent segv when files are not present
  • Loading branch information
riteshnoronha authored Aug 23, 2024
2 parents 07e003d + 20b63df commit 0424479
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/engine/score.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ func handlePaths(ctx context.Context, ep *Params) error {
paths = append(paths, sbomFilePath)
} else {
log.Debugf("Processing path :%s\n", path)
pathInfo, _ := os.Stat(path)
pathInfo, err := os.Stat(path)
if err != nil {
log.Debugf("os.Stat failed for path:%s\n", path)
log.Infof("%s\n", err)
continue
}

if pathInfo.IsDir() {
files, err := os.ReadDir(path)
if err != nil {
Expand Down

0 comments on commit 0424479

Please sign in to comment.