提交 2816ed03 作者: Matt Bell

commands: Fixed panic when marshalers gave nil output

上级 97a36884
......@@ -160,7 +160,14 @@ func (r *response) Marshal() (io.Reader, error) {
}
}
return marshaller(r)
output, err := marshaller(r)
if err != nil {
return nil, err
}
if output == nil {
return bytes.NewReader([]byte{}), nil
}
return output, nil
}
// Reader returns an `io.Reader` representing marshalled output of this Response
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论