Skip to content

Commit 7b7089e

Browse files
authoredFeb 19, 2025··
Doug/fix manifest issue (#56)
* Fix for None type issue with Manifest Files
1 parent cde8660 commit 7b7089e

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed
 

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ test.py
2222
file_generator.py
2323
.coverage
2424
.env.local
25-
Pipfile
25+
Pipfile
26+
test/

‎socketsecurity/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.0.4'
2+
__version__ = '2.0.6'

‎socketsecurity/core/__init__.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -601,12 +601,13 @@ def get_source_data(package: Package, packages: dict) -> list:
601601
if top_package:
602602
manifests = ""
603603
top_purl = f"{top_package.type}/{top_package.name}@{top_package.version}"
604-
for manifest_data in top_package.manifestFiles:
605-
manifest_file = manifest_data.get("file")
606-
manifests += f"{manifest_file};"
607-
manifests = manifests.rstrip(";")
608-
source = (top_purl, manifests)
609-
introduced_by.append(source)
604+
if hasattr(top_package, "manifestFiles") and top_package.manifestFiles:
605+
for manifest_data in top_package.manifestFiles:
606+
manifest_file = manifest_data.get("file")
607+
manifests += f"{manifest_file};"
608+
manifests = manifests.rstrip(";")
609+
source = (top_purl, manifests)
610+
introduced_by.append(source)
610611
else:
611612
log.debug(f"Unable to get top level package info for {top_id}")
612613
return introduced_by

0 commit comments

Comments
 (0)
Please sign in to comment.