Skip to content

Commit

Permalink
Doug/fix manifest issue (#56)
Browse files Browse the repository at this point in the history
* Fix for None type issue with Manifest Files
  • Loading branch information
dacoburn authored Feb 19, 2025
1 parent cde8660 commit 7b7089e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ test.py
file_generator.py
.coverage
.env.local
Pipfile
Pipfile
test/
2 changes: 1 addition & 1 deletion socketsecurity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__author__ = 'socket.dev'
__version__ = '2.0.4'
__version__ = '2.0.6'
13 changes: 7 additions & 6 deletions socketsecurity/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b7089e

Please sign in to comment.