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

@@ -368,8 +368,10 @@ static const char *
cmd_query(struct skynet_context * context, const char * param) {
if (param[0] == '.') {
uint32_t handle = skynet_handle_findname(param+1);
sprintf(context->result, ":%x", handle);
return context->result;
if (handle) {
sprintf(context->result, ":%x", handle);
return context->result;
}
}
return NULL;
}