Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@chrishenzie
Copy link
Contributor

@chrishenzie chrishenzie commented Dec 16, 2025

The GraphQL API can return null nodes in the projectItems connection, causing a runtime panic (nil pointer dereference) when the CLI attempted to access fields on these nil nodes. This crash occurs even with personal access tokens with full read access.

Adds a check to safely skip nil nodes in ProjectsV2ItemsForIssue and ProjectsV2ItemsForPullRequest.

Fixes #12325

The GraphQL API can return `null` nodes in the `projectItems`
connection, causing a runtime panic (nil pointer dereference) when the
CLI attempted to access fields on these nil nodes. This crash occurs
even with personal access tokens with full read access.

Adds a check to safely skip `nil` nodes in `ProjectsV2ItemsForIssue` and
`ProjectsV2ItemsForPullRequest`.

Signed-off-by: Chris Henzie <[email protected]>
@chrishenzie chrishenzie requested a review from a team as a code owner December 16, 2025 19:20
@chrishenzie chrishenzie requested a review from BagToad December 16, 2025 19:20
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Dec 16, 2025
@cliAutomation
Copy link
Collaborator

Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message.

Copy link
Member

@andyfeller andyfeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding tests to ensure this works as expected, but it looks good to me 👍

Thanks @chrishenzie!

@andyfeller andyfeller enabled auto-merge December 22, 2025 15:18
@andyfeller andyfeller merged commit 6acf74e into cli:trunk Dec 22, 2025
10 of 11 checks passed
@chrishenzie chrishenzie deleted the nil-ptr-deref branch December 22, 2025 17:39
@pahruroji140821-lgtm
Copy link

FB_IMG_1756554615063

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic in gh pr view --comments due to nil pointer dereference in project items

4 participants