Skip to content

Commit

Permalink
Don't try to create PURLs from empty strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
febuiles committed May 31, 2023
1 parent 554aaf5 commit 0b306ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/licenses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export async function getInvalidLicenseChanges(
// Takes the changes from the groupedChanges object and filters out the ones that are part of the exclusions list
// It does by creating a new PackageURL object from the change and comparing it to the exclusions list
groupedChanges.licensed = groupedChanges.licensed.filter(change => {
if (change.package_url.length === 0) {
return true
}

const changeAsPackageURL = PackageURL.fromString(change.package_url)

// We want to find if the licenseExclussion list contains the PackageURL of the Change
Expand All @@ -56,8 +60,9 @@ export async function getInvalidLicenseChanges(
) !== -1
) {
return false
} else {
return true
}
return true
})
const licensedChanges: Changes = groupedChanges.licensed

Expand Down

0 comments on commit 0b306ae

Please sign in to comment.