Skip to content

Commit 0205a7e

Browse files
committed
If there is no info. from OWASP, the comment 'OWASP Result' is not printed
1 parent 2366713 commit 0205a7e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/fosslight_binary/_jar_analysis.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,16 @@ def ananlyze_jar_file(path_to_find_bin):
133133
if oss_ver == "" and (product_info['name'] == 'Implementation-Version' or product_info['name'] == 'Bundle-Version'):
134134
oss_ver = product_info['value']
135135

136-
oss = OssItem(oss_name, oss_ver, oss_license, oss_dl_url)
137-
oss.set_comment("OWASP Result. ")
138-
139-
remove_owasp_item = owasp_items.get(file_with_path)
140-
if remove_owasp_item:
141-
remove_owasp_item.append(oss)
142-
else:
143-
owasp_items[file_with_path] = [oss]
136+
137+
if oss_name != "" or oss_ver != "" or oss_license != "" or oss_dl_url != "":
138+
oss = OssItem(oss_name, oss_ver, oss_license, oss_dl_url)
139+
oss.set_comment("OWASP Result. ")
140+
141+
remove_owasp_item = owasp_items.get(file_with_path)
142+
if remove_owasp_item:
143+
remove_owasp_item.append(oss)
144+
else:
145+
owasp_items[file_with_path] = [oss]
144146

145147
except Exception as ex:
146148
logger.warning(f"Error to read json file : {ex}")

0 commit comments

Comments
 (0)