mcp/server: fix nil PingParams in server.Ping (#163)

Use OrZero in case PingParams is nil to avoid typed nil.

Fixes: #162
This commit is contained in:
Sam Thanawalla 2025-07-23 15:40:57 -04:00 • committed by GitHub
commit 94b88a26e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -610,7 +610,7 @@ func (ss *ServerSession) ID() string {
// Ping pings the client.
func (ss *ServerSession) Ping(ctx context.Context, params *PingParams) error {
_, err := handleSend[*emptyResult](ctx, ss, methodPing, params)
_, err := handleSend[*emptyResult](ctx, ss, methodPing, orZero[Params](params))
return err
}