From 219b15e9ecc0e4ecb13502d7d19d63b03fb49c9a Mon Sep 17 00:00:00 2001 From: zhuilang <490240398@qq.com> Date: Thu, 3 Jun 2021 19:11:54 +0800 Subject: [PATCH] Update skynet.lua (#1415) update skynet.ret --- lualib/skynet.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lualib/skynet.lua b/lualib/skynet.lua index 4f1ae174..cfa23fb9 100644 --- a/lualib/skynet.lua +++ b/lualib/skynet.lua @@ -633,6 +633,9 @@ function skynet.ret(msg, sz) local tag = session_coroutine_tracetag[running_thread] if tag then c.trace(tag, "response") end local co_session = session_coroutine_id[running_thread] + if co_session == nil then + error "No session" + end session_coroutine_id[running_thread] = nil if co_session == 0 then if sz ~= nil then @@ -641,9 +644,6 @@ function skynet.ret(msg, sz) return false -- send don't need ret end local co_address = session_coroutine_address[running_thread] - if not co_session then - error "No session" - end local ret = c.send(co_address, skynet.PTYPE_RESPONSE, co_session, msg, sz) if ret then return true