Skip to content

Commit 0b306ae

Browse files
author
Federico Builes
committed
Don't try to create PURLs from empty strings.
1 parent 554aaf5 commit 0b306ae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/licenses.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export async function getInvalidLicenseChanges(
4141
// Takes the changes from the groupedChanges object and filters out the ones that are part of the exclusions list
4242
// It does by creating a new PackageURL object from the change and comparing it to the exclusions list
4343
groupedChanges.licensed = groupedChanges.licensed.filter(change => {
44+
if (change.package_url.length === 0) {
45+
return true
46+
}
47+
4448
const changeAsPackageURL = PackageURL.fromString(change.package_url)
4549

4650
// We want to find if the licenseExclussion list contains the PackageURL of the Change
@@ -56,8 +60,9 @@ export async function getInvalidLicenseChanges(
5660
) !== -1
5761
) {
5862
return false
63+
} else {
64+
return true
5965
}
60-
return true
6166
})
6267
const licensedChanges: Changes = groupedChanges.licensed
6368

0 commit comments

Comments
 (0)