fix: ensure we always serialize an empty map if nil

This commit is contained in:
Derrick Hammer 2024-01-05 04:35:20 -05:00
parent 15030b6866
commit d39f959e31
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 0 deletions

View File

@ -71,5 +71,8 @@ func (dmd *DirectoryMetadataDetails) DecodeMsgpack(dec *msgpack.Decoder) error {
}
func (dmd DirectoryMetadataDetails) EncodeMsgpack(enc *msgpack.Encoder) error {
if dmd.Data == nil {
dmd.Data = make(map[int]interface{})
}
return enc.Encode(dmd.Data)
}