Skip to content

Commit

Permalink
fix(rpc): nil panic in rpc/json/handler.go WriteError (#750)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
2 people authored and omritoptix committed May 1, 2024
1 parent a828e50 commit 365f33b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rpc/json/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import (

tmjson "github.com/tendermint/tendermint/libs/json"

"github.com/dymensionxyz/dymint/types"
"github.com/gorilla/rpc/v2"
"github.com/gorilla/rpc/v2/json2"

"github.com/dymensionxyz/dymint/types"
)

type handler struct {
Expand Down Expand Up @@ -70,6 +71,7 @@ func (h *handler) serveJSONRPCforWS(w http.ResponseWriter, r *http.Request, wsCo
}
methodSpec, ok := h.srv.methods[method]
if !ok {
err := fmt.Errorf("method not found: %s", method)
codecReq.WriteError(w, int(json2.E_NO_METHOD), err)
return
}
Expand Down

0 comments on commit 365f33b

Please sign in to comment.