fix bug with result array

This commit is contained in:
2025-08-06 19:36:08 +03:00
parent 35cebee819
commit 39532f22ea

View File

@@ -517,13 +517,7 @@ func (h *HandlerV1) handleLUA(sid string, r *http.Request, req *rpc.RPCRequest,
resultVal := outTbl.RawGetString("result") resultVal := outTbl.RawGetString("result")
if resultVal != lua.LNil { if resultVal != lua.LNil {
payload := make(map[string]any) return rpc.NewResponse(ConvertLuaTypesToGolang(resultVal), req.ID)
if tbl, ok := resultVal.(*lua.LTable); ok {
tbl.ForEach(func(k, v lua.LValue) { payload[k.String()] = ConvertLuaTypesToGolang(v) })
} else {
return rpc.NewResponse(ConvertLuaTypesToGolang(resultVal), req.ID)
}
return rpc.NewResponse(payload, req.ID)
} }
return rpc.NewResponse(nil, req.ID) return rpc.NewResponse(nil, req.ID)
} }