File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -326,6 +326,12 @@ def _get_metrics_graphql(
326
326
data = response .json ()
327
327
repo_data = data ["data" ]["repository" ]
328
328
329
+ if not repo_data :
330
+ logger .warning (
331
+ f"Repository metrics not able to be retrieved (it may not be on GitHub?): { repo_info ['owner' ]} /{ repo_info ['repo_name' ]} ."
332
+ )
333
+ return None
334
+
329
335
return {
330
336
"name" : repo_data ["name" ],
331
337
"description" : repo_data ["description" ],
@@ -381,7 +387,8 @@ def get_repo_meta(
381
387
If the repository is not found or access is forbidden, it returns None.
382
388
"""
383
389
metrics = self ._get_metrics_graphql (repo_info )
384
- metrics ["contrib_count" ] = self ._get_contrib_count_rest (repo_info )
390
+ if metrics is not None :
391
+ metrics ["contrib_count" ] = self ._get_contrib_count_rest (repo_info )
385
392
386
393
return metrics
387
394
You can’t perform that action at this time.
0 commit comments