@cryptotaxi247 / kubo / commits / b61cfd922

commands: Don't error when marshalling empty Responses

Matt Bell committed Oct 29, 2014 at 02:20 UTC b61cfd9224339dd74188e9dd81f606b36a85a0bd
1 file changed +1 -1
commands/response.go
+1 -1
@@ -120,7 +120,7 @@ func (r *response) SetError(err error, code ErrorType) {
120
121 func (r *response) Marshal() ([]byte, error) {
122 if r.err == nil && r.value == nil {
123 - return nil, fmt.Errorf("No error or value set, there is nothing to marshal")
123 + return []byte{}, nil
124 }
125
126 enc, ok := r.req.Option(EncShort)