skynet.localname return nil when the name not exist

This commit is contained in:
Cloud Wu
2014-07-13 19:37:08 +08:00
parent 2e35f405e7
commit 3bc7304609
2 changed files with 8 additions and 3 deletions

View File

@@ -229,7 +229,10 @@ function skynet.self()
end
function skynet.localname(name)
return string_to_handle(c.command("QUERY", name))
local addr = c.command("QUERY", name)
if addr then
return string_to_handle(addr)
end
end
function skynet.launch(...)