return 0 when send to an invalid address

This commit is contained in:
云风
2013-09-18 16:42:23 +08:00
parent ed09f28481
commit e5e73c2efe

View File

@@ -302,7 +302,8 @@ _send(lua_State *L) {
} }
if (session < 0) { if (session < 0) {
// send to invalid address // send to invalid address
return 0; // todo: maybe throw error is better
session = 0;
} }
lua_pushinteger(L,session); lua_pushinteger(L,session);
return 1; return 1;