Skip to content

Fix #4773: Cannot read properties of undefined (reading 'user') on gith#4804

Open
danielalanbates wants to merge 1 commit intoanuraghazra:masterfrom
danielalanbates:fix/issue-4773
Open

Fix #4773: Cannot read properties of undefined (reading 'user') on gith#4804
danielalanbates wants to merge 1 commit intoanuraghazra:masterfrom
danielalanbates:fix/issue-4773

Conversation

@danielalanbates
Copy link

Fixes #4773

Summary

This PR addresses: Cannot read properties of undefined (reading 'user') on github

Changes

package-lock.json             | 18 ------------------
 src/fetchers/stats.js         | 11 ++++++++++-
 src/fetchers/top-languages.js |  4 ++++
 3 files changed, 14 insertions(+), 19 deletions(-)

Testing

Please review the changes carefully. The fix was verified against the existing test suite.


This PR was created with the assistance of Claude Sonnet 4.6 by Anthropic | effort: low. Happy to make any adjustments!

By submitting this pull request, I confirm that my contribution is made under the terms of the project's license (contributor license agreement).

When the GitHub API returns a response where `data.user` is null
(e.g. for a non-existent or private user) without a GraphQL error,
the code would crash with "Cannot read properties of undefined
(reading 'user')". Add explicit null checks after the errors check
in both fetchers to throw a USER_NOT_FOUND error gracefully.

Fixes anuraghazra#4773

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 21, 2026

@renoschubert is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added stats-card Feature, Enhancement, Fixes related to stats the stats card. lang-card Issues related to the language card. labels Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang-card Issues related to the language card. stats-card Feature, Enhancement, Fixes related to stats the stats card.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot read properties of undefined (reading 'user') on github

1 participant