📜 Description
Description
When the GitHub API returns an error (e.g., user not found, rate limit exceeded),
the response is an object like { message: 'Not Found' } instead of a valid user
profile. The component attempts to access profile.avatar_url on this error object,
causing a runtime crash and blank UI.
Steps to Reproduce
- Enter an invalid or non-existent GitHub username in the search
- Observe the app crash instead of showing an error message
Expected Behavior
An error message is shown to the user (e.g., "User not found")
Actual Behavior
Component crashes trying to read avatar_url from { message: 'Not Found' }
File
src/components/ContributorProfile.tsx — line 36
Proposed Fix
Add an API error check immediately after the fetch:
if (userData.message) throw new Error(userData.message);
Environment
What browsers are you seeing the problem on?
No response
📃 Relevant Screenshots (Links)
No response
📜 Description
Description
When the GitHub API returns an error (e.g., user not found, rate limit exceeded),
the response is an object like
{ message: 'Not Found' }instead of a valid userprofile. The component attempts to access
profile.avatar_urlon this error object,causing a runtime crash and blank UI.
Steps to Reproduce
Expected Behavior
An error message is shown to the user (e.g., "User not found")
Actual Behavior
Component crashes trying to read
avatar_urlfrom{ message: 'Not Found' }File
src/components/ContributorProfile.tsx— line 36Proposed Fix
Add an API error check immediately after the fetch:
Environment
What browsers are you seeing the problem on?
No response
📃 Relevant Screenshots (Links)
No response