AP_Scripting: don't throw an exception on out of sockets in accept()

normal lua sockets don't throw an exception on accept, it just returns
nil
This commit is contained in:
Andrew Tridgell 2024-01-02 08:49:09 +11:00
parent 791a0a3230
commit a841e9c109
1 changed files with 1 additions and 1 deletions

View File

@ -913,7 +913,7 @@ int SocketAPM_accept(lua_State *L) {
auto *scripting = AP::scripting();
if (scripting->num_net_sockets >= SCRIPTING_MAX_NUM_NET_SOCKET) {
return luaL_argerror(L, 1, "no sockets available");
return 0;
}
auto *sock = ud->accept(0);