Skip to content

Fix nil pointer dereference in meta-data get on API timeout#3682

Merged
moskyb merged 1 commit intomainfrom
fix/nil-response-metadata-get
Jan 27, 2026
Merged

Fix nil pointer dereference in meta-data get on API timeout#3682
moskyb merged 1 commit intomainfrom
fix/nil-response-metadata-get

Conversation

@lox
Copy link
Contributor

@lox lox commented Jan 27, 2026

When the meta-data get API request times out or fails with a network error, the response object is nil but err is non-nil. The code was accessing resp.StatusCode to check for a 404 without first verifying that resp wasn't nil, causing a panic.

This adds a nil check before accessing the response status code.

When the API request times out or fails with a network error, the response
is nil. Accessing resp.StatusCode without a nil check causes a panic.

Amp-Thread-ID: https://ampcode.com/threads/T-019bfcda-b7d4-726d-a58e-1190729c8b6d
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@moskyb moskyb merged commit c5515e0 into main Jan 27, 2026
2 checks passed
@moskyb moskyb deleted the fix/nil-response-metadata-get branch January 27, 2026 01:02
@zhming0 zhming0 mentioned this pull request Jan 28, 2026
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.

2 participants