From 2a448fb7d3fe8758e8979996812e61345c2f3625 Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Mon, 30 Jun 2025 09:26:54 -0700 Subject: [PATCH] manifestFiles could exist for direct but be none. fixed the check --- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/core/__init__.py | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bfce7a9..95058a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.1.16" +version = "2.1.17" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index dcb63f2..d3f4d18 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.1.16' +__version__ = '2.1.17' diff --git a/socketsecurity/core/__init__.py b/socketsecurity/core/__init__.py index 4444326..c60ea38 100644 --- a/socketsecurity/core/__init__.py +++ b/socketsecurity/core/__init__.py @@ -858,12 +858,11 @@ def get_source_data(package: Package, packages: dict) -> list: introduced_by = [] if package.direct: manifests = "" - if not hasattr(package, "manifestFiles"): + if not hasattr(package, "manifestFiles") or package.manifestFiles is None: return introduced_by - if hasattr(package, "manifestFiles"): - for manifest_data in package.manifestFiles: - manifest_file = manifest_data.get("file") - manifests += f"{manifest_file};" + for manifest_data in package.manifestFiles: + manifest_file = manifest_data.get("file") + manifests += f"{manifest_file};" manifests = manifests.rstrip(";") source = ("direct", manifests) introduced_by.append(source)