add assert

This commit is contained in:
云风
2012-09-17 21:43:53 +08:00
parent e8104199de
commit 1aa89d8672
2 changed files with 8 additions and 2 deletions

View File

@@ -198,6 +198,9 @@ _sendname(lua_State *L, struct skynet_context * context, const char * dest) {
default:
luaL_error(L, "skynet.send invalid param %s", lua_type(L,4));
}
if (session < 0) {
luaL_error(L, "skynet.send session (%d) < 0", session);
}
lua_pushinteger(L,session);
return 1;
}
@@ -266,6 +269,9 @@ _send(lua_State *L) {
default:
luaL_error(L, "skynet.send invalid param %s", lua_type(L,4));
}
if (session < 0) {
luaL_error(L, "skynet.send session (%d) < 0", session);
}
lua_pushinteger(L,session);
return 1;
}