Fix typo: Causes an error when resp is false (#1260)

Co-authored-by: zhouyan <zhouyan@onemt.com.cn>
This commit is contained in:
najoast
2020-11-24 18:32:28 +08:00
committed by GitHub
parent 9eb37198ea
commit 5248d443dc

View File

@@ -32,9 +32,9 @@ local function list_srv(ti, fmt_func, ...)
sessions[r] = addr
end
for req, resp in req:select(ti) do
local stat = resp[1]
local addr = req[1]
if resp then
local stat = resp[1]
list[skynet.address(addr)] = fmt_func(stat, addr)
else
list[skynet.address(addr)] = fmt_func("ERROR", addr)