fix bug with empty result and non table result

This commit is contained in:
2025-08-06 19:17:10 +03:00
parent 84dfdd6b35
commit 35cebee819
3 changed files with 16 additions and 9 deletions

View File

@@ -25,6 +25,12 @@ func NewError(code int, message string, data any, id *json.RawMessage) *RPCRespo
}
func NewResponse(result any, id *json.RawMessage) *RPCResponse {
if result == nil {
return &RPCResponse{
JSONRPC: JSONRPCVersion,
ID: id,
}
}
return &RPCResponse{
JSONRPC: JSONRPCVersion,
ID: id,