fix: Handle ZeroDivisionError in PageRank calculation

This commit is contained in:
Paul Gauthier 2024-09-23 11:49:16 -07:00
parent ed1eb38c5f
commit a4b79127b0

View file

@ -397,6 +397,10 @@ class RepoMap:
try:
ranked = nx.pagerank(G, weight="weight", **pers_args)
except ZeroDivisionError:
# Issue #1536
try:
ranked = nx.pagerank(G, weight="weight")
except ZeroDivisionError:
return []