net.server_select: Fix traceback (thanks eta)
authorKim Alvefur <zash@zash.se>
Sun, 23 Aug 2020 22:19:29 +0200
changeset 11047 d105e787f5ed
parent 11046 8a243ab49cb5
child 11048 7b720a815519
net.server_select: Fix traceback (thanks eta) The `socket` here is unreferenced on disconnect. Calling :resume_writes after that causes an error when `addsocket()` tries to use it as a table index.
net/server_select.lua
--- a/net/server_select.lua	Sat Aug 22 14:34:57 2020 +0200
+++ b/net/server_select.lua	Sun Aug 23 22:19:29 2020 +0200
@@ -511,7 +511,7 @@
 	end
 	handler.resume_writes = function (self)
 		nosend = false
-		if bufferlen > 0 then
+		if bufferlen > 0 and socket then
 			_sendlistlen = addsocket(_sendlist, socket, _sendlistlen)
 		end
 	end