mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 15:12:26 +00:00
fix bug with result array
This commit is contained in:
@@ -517,13 +517,7 @@ func (h *HandlerV1) handleLUA(sid string, r *http.Request, req *rpc.RPCRequest,
|
||||
|
||||
resultVal := outTbl.RawGetString("result")
|
||||
if resultVal != lua.LNil {
|
||||
payload := make(map[string]any)
|
||||
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(ConvertLuaTypesToGolang(resultVal), req.ID)
|
||||
}
|
||||
return rpc.NewResponse(nil, req.ID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user