Diff

net/server.lua @ 775:d4b6714fc829

net.server: Fix nil table index assignment
author Matthew Wild <mwild1@gmail.com>
date Mon, 09 Feb 2009 14:24:49 +0000
parent 773:c36edc1934c5
child 815:cf8392613f46
line wrap: on
line diff
--- a/net/server.lua	Mon Feb 09 13:48:11 2009 +0000
+++ b/net/server.lua	Mon Feb 09 14:24:49 2009 +0000
@@ -362,7 +362,7 @@
             _closelist[ handler ] = "send buffer exceeded"   -- cannot close the client at the moment, have to wait to the end of the cycle
             handler.write = idfalse    -- dont write anymore
             return false
-        elseif not _sendlist[ socket ] then
+        elseif socket and not _sendlist[ socket ] then
             _sendlistlen = _sendlistlen + 1
             _sendlist[ _sendlistlen ] = socket
             _sendlist[ socket ] = _sendlistlen