diff --git a/.gitignore b/.gitignore index fab80bb..0962665 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ test.py file_generator.py .coverage .env.local -Pipfile \ No newline at end of file +Pipfile +test/ \ No newline at end of file diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 59b063c..2f4f50d 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.0.4' +__version__ = '2.0.6' diff --git a/socketsecurity/core/__init__.py b/socketsecurity/core/__init__.py index 18d92d7..4452072 100644 --- a/socketsecurity/core/__init__.py +++ b/socketsecurity/core/__init__.py @@ -601,12 +601,13 @@ def get_source_data(package: Package, packages: dict) -> list: if top_package: manifests = "" top_purl = f"{top_package.type}/{top_package.name}@{top_package.version}" - for manifest_data in top_package.manifestFiles: - manifest_file = manifest_data.get("file") - manifests += f"{manifest_file};" - manifests = manifests.rstrip(";") - source = (top_purl, manifests) - introduced_by.append(source) + if hasattr(top_package, "manifestFiles") and top_package.manifestFiles: + for manifest_data in top_package.manifestFiles: + manifest_file = manifest_data.get("file") + manifests += f"{manifest_file};" + manifests = manifests.rstrip(";") + source = (top_purl, manifests) + introduced_by.append(source) else: log.debug(f"Unable to get top level package info for {top_id}") return introduced_by