Skip to content

Commit

Permalink
Prevent segv when files are not present
Browse files Browse the repository at this point in the history
  • Loading branch information
riteshnoronha committed Aug 23, 2024
1 parent 07e003d commit 20b63df
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 20b63df

Please sign in to comment.