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(
326326 data = response .json ()
327327 repo_data = data ["data" ]["repository" ]
328328
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+
329335 return {
330336 "name" : repo_data ["name" ],
331337 "description" : repo_data ["description" ],
@@ -381,7 +387,8 @@ def get_repo_meta(
381387 If the repository is not found or access is forbidden, it returns None.
382388 """
383389 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 )
385392
386393 return metrics
387394
You can’t perform that action at this time.
0 commit comments