mcp: fix potential nil-pointer dereference on message send (#1115)

This commit is contained in:
Yaroslav 2026-07-27 17:20:53 +02:00 • committed by GitHub
commit bc72835f62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1386,6 +1386,12 @@ func TestStreamableClientConnSetMCPHeaders_ProtocolVersion(t *testing.T) {
msg jsonrpc.Message
want string
}{
{
name: "nil checked",
initializedResult: nil,
msg: (*jsonrpc.Request)(nil),
want: "",
},
{
name: "message meta wins when initializedResult unset",
initializedResult: nil,