diff --git a/src/lib/github.ts b/src/lib/github.ts index b15cf83..858ba40 100644 --- a/src/lib/github.ts +++ b/src/lib/github.ts @@ -110,8 +110,10 @@ export async function fetchIssuesMetrics( const repoCounts: Record = {}; for (const item of items) { - const repo = item.repository_url.split("/").pop() ?? ""; - repoCounts[repo] = (repoCounts[repo] ?? 0) + 1; + const repo = item.repository_url.split("/").at(-1) ?? ""; + if (repo) { + repoCounts[repo] = (repoCounts[repo] ?? 0) + 1; + } } const mostActiveRepo = Object.keys(repoCounts).length > 0