提交 db9c7f7c 作者: Matt Bell 提交者: Juan Batiz-Benet

commands: Fixed panic when trying to marshal without a command set in request

上级 df6c7004
......@@ -115,7 +115,10 @@ func (r *response) Marshal() ([]byte, error) {
}
encType := EncodingType(strings.ToLower(encStr))
marshaller := r.req.Command().Marshallers[encType]
var marshaller Marshaller
if r.req.Command() != nil && r.req.Command().Marshallers != nil {
marshaller = r.req.Command().Marshallers[encType]
}
if marshaller == nil {
marshaller, ok = marshallers[encType]
if !ok {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论