Skip to content

Commit

Permalink
Fix nil panic
Browse files Browse the repository at this point in the history
  • Loading branch information
dkeysil committed Mar 21, 2024
1 parent ed41b8c commit ba508cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion services/json-rpc/cache/json_rpc_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (c *JsonRpcCache) Handler() http.Handler {

agentConfig, err := c.botAuthenticator.FindAgentFromRemoteAddr(r.RemoteAddr)
if agentConfig == nil || err != nil {
writeUnauthorized(w, nil)
writeUnauthorized(w, req)
return
}

Expand Down
2 changes: 1 addition & 1 deletion services/json-rpc/cache/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type jsonRpcResp struct {
ID json.RawMessage `json:"id"`
JsonRPC string `json:"jsonrpc"`
Result json.RawMessage `json:"result"`
Error *jsonRpcError `json:"error"`
Error *jsonRpcError `json:"error,omitempty"`
}

type errorResponse struct {
Expand Down

0 comments on commit ba508cc

Please sign in to comment.