1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-15 22:50:24 +02:00

Merge pull request #422 from JensErat/map-invalid-type

pass nested error in compatible configuration, fixes #388
This commit is contained in:
Tao Wen
2019-12-21 11:10:28 +08:00
committed by GitHub
2 changed files with 35 additions and 6 deletions

View File

@ -321,6 +321,9 @@ func (encoder *sortKeysMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
}
stream.Write(keyValue.keyValue)
}
if subStream.Error != nil && stream.Error == nil {
stream.Error = subStream.Error
}
stream.WriteObjectEnd()
stream.cfg.ReturnStream(subStream)
stream.cfg.ReturnIterator(subIter)