summaryrefslogtreecommitdiff
path: root/vendor/github.com/json-iterator/go/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/json-iterator/go/config.go')
-rw-r--r--vendor/github.com/json-iterator/go/config.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/vendor/github.com/json-iterator/go/config.go b/vendor/github.com/json-iterator/go/config.go
index 8c58fcba5..2adcdc3b7 100644
--- a/vendor/github.com/json-iterator/go/config.go
+++ b/vendor/github.com/json-iterator/go/config.go
@@ -183,11 +183,11 @@ func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) {
encoder := &funcEncoder{func(ptr unsafe.Pointer, stream *Stream) {
rawMessage := *(*json.RawMessage)(ptr)
iter := cfg.BorrowIterator([]byte(rawMessage))
+ defer cfg.ReturnIterator(iter)
iter.Read()
- if iter.Error != nil {
+ if iter.Error != nil && iter.Error != io.EOF {
stream.WriteRaw("null")
} else {
- cfg.ReturnIterator(iter)
stream.WriteRaw(string(rawMessage))
}
}, func(ptr unsafe.Pointer) bool {