Commit db9c7f7c authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

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

parent 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 is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment