diff --git a/dot/rpc/subscription/websocket.go b/dot/rpc/subscription/websocket.go index cefa30cdcea..4418e564970 100644 --- a/dot/rpc/subscription/websocket.go +++ b/dot/rpc/subscription/websocket.go @@ -83,12 +83,14 @@ func (c *WSConn) HandleConn() { } logger.Tracef("websocket message received: %s", string(rawBytes)) + if wsMessage.Method == "" { c.safeSendError(0, big.NewInt(InvalidRequestCode), InvalidRequestMessage) continue } logger.Debugf("ws method %s called with params %v", wsMessage.Method, wsMessage.Params) + if !strings.Contains(wsMessage.Method, "_unsubscribe") && !strings.Contains(wsMessage.Method, "_unwatch") { setupListener := c.getSetupListener(wsMessage.Method)