1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-20 02:21:48 +08:00

commands: Don't error when marshalling empty Responses

This commit is contained in:
Matt Bell
2014-10-29 02:20:26 -07:00
committed by Juan Batiz-Benet
parent 4911dc069a
commit b61cfd9224

View File

@ -120,7 +120,7 @@ func (r *response) SetError(err error, code ErrorType) {
func (r *response) Marshal() ([]byte, error) {
if r.err == nil && r.value == nil {
return nil, fmt.Errorf("No error or value set, there is nothing to marshal")
return []byte{}, nil
}
enc, ok := r.req.Option(EncShort)