Skip to content

Commit 94b88a2

Browse files
mcp/server: fix nil PingParams in server.Ping (#163)
Use OrZero in case PingParams is nil to avoid typed nil. Fixes: #162
1 parent bcbb31f commit 94b88a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mcp/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ func (ss *ServerSession) ID() string {
610610

611611
// Ping pings the client.
612612
func (ss *ServerSession) Ping(ctx context.Context, params *PingParams) error {
613-
_, err := handleSend[*emptyResult](ctx, ss, methodPing, params)
613+
_, err := handleSend[*emptyResult](ctx, ss, methodPing, orZero[Params](params))
614614
return err
615615
}
616616

0 commit comments

Comments
 (0)