Skip to content

fix: return error instead of panicking when GetInfo resolves a nil repository#520

Open
SAY-5 wants to merge 1 commit into
ejoffe:masterfrom
SAY-5:fix-getinfo-nil-repository
Open

fix: return error instead of panicking when GetInfo resolves a nil repository#520
SAY-5 wants to merge 1 commit into
ejoffe:masterfrom
SAY-5:fix-getinfo-nil-repository

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 20, 2026

Copy link
Copy Markdown

Fixes #511.

GetInfo dereferences resp.Repository.Id right after check(err), but the GraphQL repository(owner, name) field resolves to null when the token cannot access the repo or the owner/name is wrong, and that can come back without a top-level error. When resp.Repository is nil the dereference segfaults, which is what #511 reports on every command after the repo lookup starts failing.

This guards resp.Repository in both the merge-queue and normal branches and routes it through the existing check path so users get a clear "repository not found; check the name and token access" message instead of a SIGSEGV. Added a unit test for the guard helper; a full GetInfo test would need a fake for the whole generated GraphQL client, so I kept the covered logic in a small pure helper.

…pository

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segfault in all spr commands in 0.17.6 but not 0.17.1, possibly with the github keychain thing?

1 participant