Skip to content

Commit 1a08006

Browse files
committed
Fixed corner case with license causing a breaking error if a package wasn't found
1 parent 00ca2a3 commit 1a08006

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.1.11"
9+
version = "2.1.12"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.1.11'
2+
__version__ = '2.1.12'

socketsecurity/core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def get_license_text_via_purl(self, packages: dict[str, Package]) -> dict:
562562
licenseDetails = result.get("licenseDetails")
563563
licenseAttrib = result.get("licenseAttrib")
564564
purl = f"{ecosystem}/{name}@{package_version}"
565-
if purl not in purl_packages:
565+
if purl not in purl_packages and purl in packages:
566566
packages[purl].licenseAttrib = licenseAttrib
567567
packages[purl].licenseDetails = licenseDetails
568568
return packages

0 commit comments

Comments
 (0)