We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent baa7153 commit 95201f2Copy full SHA for 95201f2
client/transport/streamable_http.go
@@ -252,7 +252,12 @@ func (c *StreamableHTTP) SendRequest(
252
return nil, fmt.Errorf("failed to send request: %w", err)
253
}
254
255
- defer resp.Body.Close()
+ // When sendHTTP fails and resp is nil but method is mcp.MethodInitialize
256
+ // defer resp.Body.Close() fails with nil pointer dereference.
257
+ // TODO: Restructure this fallthrough logic properly.
258
+ if resp != nil {
259
+ defer resp.Body.Close()
260
+ }
261
262
// Check if we got an error response
263
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusAccepted {
0 commit comments