Skip to content

Commit 165a6a9

Browse files
authored
check for nil stream when running the null check in handler (#7105)
1 parent 94729b1 commit 165a6a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rpc/handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,9 @@ var nullAsBytes = []byte{110, 117, 108, 108}
524524
// there are many avenues that could lead to an error being handled in runMethod, so we need to check
525525
// if nil has already been written to the stream before writing it again here
526526
func writeNilIfNotPresent(stream *jsoniter.Stream) {
527+
if stream == nil {
528+
return
529+
}
527530
b := stream.Buffer()
528531
hasNil := true
529532
if len(b) >= 4 {

0 commit comments

Comments
 (0)