Skip to content

Commit

Permalink
Avoid panic in code (#1171)
Browse files Browse the repository at this point in the history
Co-authored-by: Azeem Shaikh <[email protected]>
  • Loading branch information
azeemshaikh38 and azeemsgoogle authored Oct 27, 2021
1 parent 53ae583 commit 0ba864e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion checks/pinned_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,9 @@ func getOSesForJob(job *gitHubActionWorkflowJob) ([]string, error) {
if osVal, ok := m["os"]; ok {
if oses, ok := osVal.([]interface{}); ok {
for _, os := range oses {
jobOSes = append(jobOSes, os.(string))
if strVal, ok := os.(string); ok {
jobOSes = append(jobOSes, strVal)
}
}
return jobOSes, nil
}
Expand Down

0 comments on commit 0ba864e

Please sign in to comment.