Skip to content

Commit

Permalink
fix: CallClientStream result has error, result.Result() is nil to *tr…
Browse files Browse the repository at this point in the history
…i.Response will cause a panic (#2732)
  • Loading branch information
linfeip authored Sep 26, 2024
1 parent 4329b00 commit f03922a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion protocol/triple/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,12 @@ func (s *Server) handleServiceWithInfo(interfaceName string, invoker protocol.In
ctx = context.WithValue(ctx, constant.AttachmentKey, attachments)
invo := invocation.NewRPCInvocation(m.Name, args, attachments)
res := invoker.Invoke(ctx, invo)
return res.Result().(*tri.Response), res.Error()
if triResp, ok := res.Result().(*tri.Response); ok {
return triResp, res.Error()
}
// please refer to proxy/proxy_factory/ProxyInvoker.Invoke
triResp := tri.NewResponse([]interface{}{res.Result()})
return triResp, res.Error()
},
opts...,
)
Expand Down

0 comments on commit f03922a

Please sign in to comment.