summaryrefslogtreecommitdiff
path: root/vendor/github.com/json-iterator/go/any.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/json-iterator/go/any.go')
-rw-r--r--vendor/github.com/json-iterator/go/any.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/vendor/github.com/json-iterator/go/any.go b/vendor/github.com/json-iterator/go/any.go
index daecfed61..f6b8aeab0 100644
--- a/vendor/github.com/json-iterator/go/any.go
+++ b/vendor/github.com/json-iterator/go/any.go
@@ -312,6 +312,10 @@ func (codec *directAnyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
func (codec *directAnyCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
any := *(*Any)(ptr)
+ if any == nil {
+ stream.WriteNil()
+ return
+ }
any.WriteTo(stream)
}