From 365f33b628715b6ed0d4fcd5f2ad457ec6c19ef6 Mon Sep 17 00:00:00 2001 From: zale144 Date: Wed, 1 May 2024 18:32:27 +0200 Subject: [PATCH] fix(rpc): nil panic in rpc/json/handler.go WriteError (#750) Co-authored-by: github-actions --- rpc/json/handler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpc/json/handler.go b/rpc/json/handler.go index fb08a789f..164b1f329 100644 --- a/rpc/json/handler.go +++ b/rpc/json/handler.go @@ -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 { @@ -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 }