Skip to content

Commit 04b4420

Browse files
authored
manifestFiles could exist for direct but be none. fixed the check (#96)
1 parent 31003ad commit 04b4420

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.1.16"
9+
version = "2.1.17"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.1.16'
2+
__version__ = '2.1.17'

socketsecurity/core/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -858,12 +858,11 @@ def get_source_data(package: Package, packages: dict) -> list:
858858
introduced_by = []
859859
if package.direct:
860860
manifests = ""
861-
if not hasattr(package, "manifestFiles"):
861+
if not hasattr(package, "manifestFiles") or package.manifestFiles is None:
862862
return introduced_by
863-
if hasattr(package, "manifestFiles"):
864-
for manifest_data in package.manifestFiles:
865-
manifest_file = manifest_data.get("file")
866-
manifests += f"{manifest_file};"
863+
for manifest_data in package.manifestFiles:
864+
manifest_file = manifest_data.get("file")
865+
manifests += f"{manifest_file};"
867866
manifests = manifests.rstrip(";")
868867
source = ("direct", manifests)
869868
introduced_by.append(source)

0 commit comments

Comments
 (0)