Skip to content

Commit 7302e9c

Browse files
2.2.0 Commit
1 parent 5d6c225 commit 7302e9c

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

github/get/beagle-insights/src/formula/formula.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ def Run(user, key, contribution):
3535
url, auth=HTTPBasicAuth(user, key),
3636
).json()
3737

38-
forks = repo_stats["items"][0]["forks_count"]
39-
stars = repo_stats["items"][0]["stargazers_count"]
38+
try:
39+
forks = repo_stats["items"][0]["forks_count"]
40+
except IndexError:
41+
forks = "-"
42+
43+
try:
44+
stars = repo_stats["items"][0]["stargazers_count"]
45+
except IndexError:
46+
stars = "-"
4047

4148
insights.append(
4249
{

github/get/charles-insights/src/formula/formula.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ def Run(user, key, contribution):
3535
url, auth=HTTPBasicAuth(user, key),
3636
).json()
3737

38-
forks = repo_stats["items"][0]["forks_count"]
39-
stars = repo_stats["items"][0]["stargazers_count"]
38+
try:
39+
forks = repo_stats["items"][0]["forks_count"]
40+
except IndexError:
41+
forks = "-"
42+
43+
try:
44+
stars = repo_stats["items"][0]["stargazers_count"]
45+
except IndexError:
46+
stars = "-"
4047

4148
insights.append(
4249
{

github/get/ritchie-insights/src/formula/formula.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ def Run(user, key, contribution):
3535
url, auth=HTTPBasicAuth(user, key),
3636
).json()
3737

38-
forks = repo_stats["items"][0]["forks_count"]
39-
stars = repo_stats["items"][0]["stargazers_count"]
38+
try:
39+
forks = repo_stats["items"][0]["forks_count"]
40+
except IndexError:
41+
forks = "-"
42+
43+
try:
44+
stars = repo_stats["items"][0]["stargazers_count"]
45+
except IndexError:
46+
stars = "-"
4047

4148
insights.append(
4249
{

0 commit comments

Comments
 (0)