check for nil stream when running the null check in handler (#7105)

This commit is contained in:
hexoscott 2023-03-15 04:03:16 +00:00 committed by GitHub
parent 94729b1e82
commit 165a6a950d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -524,6 +524,9 @@ var nullAsBytes = []byte{110, 117, 108, 108}
// there are many avenues that could lead to an error being handled in runMethod, so we need to check
// if nil has already been written to the stream before writing it again here
func writeNilIfNotPresent(stream *jsoniter.Stream) {
if stream == nil {
return
}
b := stream.Buffer()
hasNil := true
if len(b) >= 4 {