Skip to content

Commit 5fa3962

Browse files
committed
Refactor invokeMethod function
1 parent f93d676 commit 5fa3962

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

handler_func.go

+3
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@ func invokeMethod(c context.Context, r *Request) *Response {
4040
return res
4141
}
4242
res.Result, res.Error = h.ServeJSONRPC(WithRequestID(c, r.ID), r.Params)
43+
if res.Error != nil {
44+
res.Result = nil
45+
}
4346
return res
4447
}

handler_func17.go

+3
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@ func invokeMethod(c context.Context, r *Request) *Response {
4040
return res
4141
}
4242
res.Result, res.Error = h.ServeJSONRPC(WithRequestID(c, r.ID), r.Params)
43+
if res.Error != nil {
44+
res.Result = nil
45+
}
4346
return res
4447
}

0 commit comments

Comments
 (0)