Lua: Fix router.PickOutbound to use dot syntax

This commit is contained in:
Meo597
2026-10-11 04:26:53 +08:00
parent 701af60772
commit 0fe8514f93
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -30,9 +30,9 @@ func (r *Router) RegisterLua(L *lua.LState) {
module.RawSetString("LocalOS", lua.LString(runtime.GOOS))
module.RawSetString("PickOutbound", L.NewFunction(func(L *lua.LState) int {
tag, ok := L.Get(2).(lua.LString)
tag, ok := L.Get(1).(lua.LString)
if !ok {
L.ArgError(2, "balancer tag must be a string")
L.ArgError(1, "balancer tag must be a string")
return 0
}
balancer, found := (*r.balancers.Load())[string(tag)]