Skip to content

Commit

Permalink
Merge pull request #1223 from jonjohnsonjr/panic
Browse files Browse the repository at this point in the history
Avoid panic if no external config file ref
  • Loading branch information
jonjohnsonjr authored May 22, 2024
2 parents e162d67 + e0fa3ec commit fbf0b9b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,10 +737,12 @@ func (b *Build) BuildPackage(ctx context.Context) error {
return fmt.Errorf("failed to create ExternalRef for configfile: %w", err)
}

// In SPDX v3 there is dedicate field for this
// https://spdx.github.io/spdx-spec/v3.0/model/Build/Properties/configSourceUri/
log.Infof("adding external ref %s for ConfigFile", configFileRef)
externalRefs = append(externalRefs, *configFileRef)
if configFileRef != nil {
// In SPDX v3 there is dedicate field for this
// https://spdx.github.io/spdx-spec/v3.0/model/Build/Properties/configSourceUri/
log.Infof("adding external ref %s for ConfigFile", configFileRef)
externalRefs = append(externalRefs, *configFileRef)
}

if b.EmptyWorkspace {
log.Infof("empty workspace requested")
Expand Down

0 comments on commit fbf0b9b

Please sign in to comment.