Skip to content

Commit 8f33297

Browse files
committed
fixing missing outcomes
1 parent e6debf3 commit 8f33297

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

vulnfeeds/conversion/nvd/converter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ func CVEToOSV(cve models.NVDCVE, repos []string, cache *git.RepoTagsCache, direc
5252

5353
// If there are no repos, there are no commits from the refs either
5454
if len(cpeRanges) == 0 && len(repos) == 0 {
55+
metrics.SetOutcome(models.NoRepos)
5556
outputFiles(v, directory, maybeVendorName, maybeProductName, metrics, rejectFailed, outputMetrics)
5657
return models.NoRepos
5758
}

vulnfeeds/models/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (m *ConversionMetrics) AddNote(format string, a ...any) {
6161

6262
// SetOutcome sets the outcome of the conversion only if it's not already set, or has become successful.
6363
func (m *ConversionMetrics) SetOutcome(outcome ConversionOutcome) {
64-
if m.Outcome != ConversionUnknown || outcome != Successful {
64+
if m.Outcome != ConversionUnknown || m.Outcome == Successful {
6565
return
6666
}
6767
m.Outcome = outcome

0 commit comments

Comments
 (0)