Skip to content

Commit

Permalink
check for nil stream when running the null check in handler (#7105)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexoscott authored Mar 15, 2023
1 parent 94729b1 commit 165a6a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 165a6a9

Please sign in to comment.