mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-22 04:09:04 +08:00
commands: Don't error when marshalling empty Responses
This commit is contained in:

committed by
Juan Batiz-Benet

parent
4911dc069a
commit
b61cfd9224
@ -120,7 +120,7 @@ func (r *response) SetError(err error, code ErrorType) {
|
|||||||
|
|
||||||
func (r *response) Marshal() ([]byte, error) {
|
func (r *response) Marshal() ([]byte, error) {
|
||||||
if r.err == nil && r.value == nil {
|
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)
|
enc, ok := r.req.Option(EncShort)
|
||||||
|
Reference in New Issue
Block a user