Skip to content

Commit 8f6071a

Browse files
authored
fix: explicitly check firstError !== null in getGraphQLErrorMessage (JhaSourav07#1871)
## Description Fixes JhaSourav07#1850 ## Pillar - [ ] 🎨 Pillar 1 — New Theme Design - [ ] 📐 Pillar 2 — Geometric SVG Improvement - [ ] 🕐 Pillar 3 — Timezone Logic Optimization - [X] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview No visual changes, this is a runtime safety fix in lib/github.ts. ## Checklist before requesting a review: - [X] I have read the `CONTRIBUTING.md` file. - [ ] I have tested these changes locally (`localhost:3000/api/streak?user=YOUR_USERNAME`). - [X] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [X] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [ ] I have updated `README.md` if I added a new theme or URL parameter. - [ ] I have started the repo. - [X] I have made sure that i have only one commit to merge in this PR. - [ ] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). - [X] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents 3a585c8 + 23554b7 commit 8f6071a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function getGraphQLErrorMessage(errors: unknown): string {
173173
if (!Array.isArray(errors)) return 'GitHub GraphQL API returned an unknown error';
174174
const firstError = errors[0];
175175
if (
176-
firstError &&
176+
firstError !== null &&
177177
typeof firstError === 'object' &&
178178
'message' in firstError &&
179179
typeof firstError.message === 'string'

0 commit comments

Comments
 (0)