Skip to content

Commit

Permalink
config: fix scorecard sigsegv
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphcw committed Aug 28, 2023
1 parent 7abad14 commit 9a0c4ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func fetchConfig(ctx context.Context, r repositories, owner, repoIn, name string
p = path.Join(operator.RepoConfigDir, name)
}
cf, _, rsp, err := walkGC(ctx, r, owner, repo, p, nil)
if err != nil {
if cf == nil || err != nil {
if rsp != nil && rsp.StatusCode == http.StatusNotFound {
return nil
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/policies/scorecard/scorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ func listJoin(list []string) string {
func convertLogs(logs []checker.CheckDetail) []string {
var s []string
for _, l := range logs {
if (l.Msg.Finding == nil) {
continue
}
if l.Msg.Finding.Location == nil {
s = append(s, fmt.Sprintf("%v", l.Msg.Finding.Message))
} else {
Expand Down

0 comments on commit 9a0c4ba

Please sign in to comment.