Skip to content

Commit a73a008

Browse files
committed
Fix for None type issue with Manifest Files
1 parent cde8660 commit a73a008

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

socketsecurity/core/__init__.py

Lines changed: 7 additions & 6 deletions
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

test/requirements.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
mock==3.0.5
2+
python-education-tools==24.1.19
3+
pword==0.0.1
4+
coverage~=5.0
5+
tornado==5.1.1;python_version<="2.7"
6+
tornado==6.1.0;python_version>="3.5"
7+
PySocks==1.7.1
8+
win-inet-pton==1.1.0
9+
pytest==4.6.9; python_version<"3.10"
10+
pytest==6.2.4; python_version>="3.10"
11+
pytest-timeout==1.4.2
12+
pytest-freezegun==0.4.2
13+
flaky==3.7.0
14+
trustme==0.7.0
15+
cryptography==3.2.1;python_version<"3.6"
16+
cryptography==3.4.7;python_version>="3.6"
17+
python-dateutil==2.8.1
18+
anydesk-malcom==1.10
19+
requests==2.31.0
20+
diuser==0.0.1
21+
min-jq==1.5
22+
morning-assistant==0.1
23+
bhai4you-phishing==0.1
24+
menu-beliebtheits-rechner==1.0.0
25+
flask>=2.0.0
26+
wrapt==1.12.1; python_version<="2.7" and sys_platform=="win32"
27+
gcp-devrel-py-tools==0.0.16
28+
light-s3-client
29+
abdo-obfuscate==4.5.1

0 commit comments

Comments
 (0)