From d8a31614d274f390f829aa9d00147aaea891a355 Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Tue, 20 Aug 2024 13:15:36 +0200 Subject: [PATCH] fix: fix retrieval of Github license --- ai4papi/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai4papi/utils.py b/ai4papi/utils.py index 6f1833a..60ff17c 100644 --- a/ai4papi/utils.py +++ b/ai4papi/utils.py @@ -194,7 +194,7 @@ def get_github_info(owner, repo): repo_data['updated_at'], "%Y-%m-%dT%H:%M:%SZ", ).date().strftime("%Y-%m-%d") - out['license'] = repo_data['license']['spdx_id'] + out['license'] = (repo_data['license'] or {}).get('spdx_id', '') # out['stars'] = repo_data['stargazers_count'] else: print(f'Failed to parse Github repo: {owner}/{repo}')