Skip to content

Commit b235251

Browse files
committed
Fix the gradle license parsing error
Signed-off-by: Jiyeong Seok <[email protected]>
1 parent 59e115c commit b235251

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/fosslight_dependency/analyze_dependency.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,13 @@ def parse_and_generate_output_gradle(input_fp):
761761
oss_version = version_refine(oss_ini_version)
762762

763763
license_names = []
764-
for licenses in d['licenses']:
765-
license_names.append(licenses['name'].replace(",", ""))
766-
license_name = ', '.join(license_names)
764+
try:
765+
for licenses in d['licenses']:
766+
if licenses['name'] != '':
767+
license_names.append(licenses['name'].replace(",", ""))
768+
license_name = ', '.join(license_names)
769+
except Exception:
770+
logger.info("Cannot find the license name")
767771

768772
if used_filename == "true" or group_id == "":
769773
dn_loc = 'Unknown'

0 commit comments

Comments
 (0)