Skip to content

Commit

Permalink
Merge pull request #32 from softwaresaved/31-bug-license_file_paths-a…
Browse files Browse the repository at this point in the history
…ccessed-when-none

[Fix] Don't access undefined object
  • Loading branch information
karacolada authored May 23, 2024
2 parents de17fc9 + 29b600d commit a21f96e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fuji_server/evaluators/fair_evaluator_license_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def setLicenseDataAndOutput(self):
self.license_info = []
# check for any recognised license files
parsed_license_file_data = self.fuji.github_data.get("license_file")
if parsed_license_file_data is not None and len(parsed_license_file_data) > 0:
license_file_paths = [lf["path"] for lf in parsed_license_file_data]
metadata_license = self.fuji.github_data.get("license")
metadata_license_path = self.fuji.github_data.get("license_path")
recognised_licenses = []
if metadata_license is not None:
for lfp in license_file_paths: # only use metadata information if it matches a license file
if lfp == metadata_license_path:
recognised_licenses.append(metadata_license)
if parsed_license_file_data is not None and len(parsed_license_file_data) > 0:
license_file_paths = [lf["path"] for lf in parsed_license_file_data]
for lfp in license_file_paths: # only use metadata information if it matches a license file
if lfp == metadata_license_path:
recognised_licenses.append(metadata_license)
if recognised_licenses is not None and recognised_licenses != []:
for license in recognised_licenses:
isurl = False
Expand Down

0 comments on commit a21f96e

Please sign in to comment.