Skip to content

Commit 4a9f3d9

Browse files
authored
Bug fix: wrap nil err (fanal#37)
1 parent d5d2729 commit 4a9f3d9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

analyzer/analyzer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,10 @@ func GetPackages(filesMap extractor.FileMap) ([]Package, error) {
164164
// Differentiate between a package manager not being found and another error
165165
if err != nil && err == ErrNoPkgsDetected {
166166
continue
167+
} else if err != nil {
168+
return nil, xerrors.Errorf("failed to analyze packages: %w", err)
167169
}
168-
return pkgs, xerrors.Errorf("failed to analyze packages: %w", err)
170+
return pkgs, nil
169171
}
170172
return nil, ErrPkgAnalysis
171173
}

0 commit comments

Comments
 (0)