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:

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) {
|
||||
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)
|
||||
|
Reference in New Issue
Block a user