Commit cd8868d1 authored by Matt Bell's avatar Matt Bell

commands: Fixed panic when marshalers gave nil output

parent b74f5b93
......@@ -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 is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment