Skip to content

Commit

Permalink
Avoid index out of range error (#4253)
Browse files Browse the repository at this point in the history
  • Loading branch information
stacimc authored May 1, 2024
1 parent 3c8b12d commit 7ff92d2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def _get_license_info(image_data) -> LicenseInfo | None:
# some items do not return license anywhere, but in the UI
# they look like CC
rights = image_data.get("legal", {}).get("rights")
if isinstance(rights, list):
if rights and isinstance(rights, list):
license_name = rights[0].get("licence")
if not license_name:
return None
Expand Down

0 comments on commit 7ff92d2

Please sign in to comment.