Don't try to output anything if item collection is empty
This commit is contained in:
parent
f32e7aa1f4
commit
897ab70990
|
@ -35,6 +35,9 @@ func (i ItemCollection) IsObject() bool {
|
|||
|
||||
// MarshalJSON encodes the receiver object to a JSON document.
|
||||
func (i ItemCollection) MarshalJSON() ([]byte, error) {
|
||||
if i == nil {
|
||||
return nil, nil
|
||||
}
|
||||
b := make([]byte, 0)
|
||||
writeItemCollectionJSONValue(&b, i)
|
||||
return b, nil
|
||||
|
|
Reference in a new issue