aboutsummaryrefslogtreecommitdiffstats
path: root/net/server.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-02-18 19:23:29 +0000
committerMatthew Wild <mwild1@gmail.com>2009-02-18 19:23:29 +0000
commit81287473fc3b61e9ba74216e84ddf1c6d8215b31 (patch)
treebd79a97d51444dbfae29ddaebb2b6c8e3f404254 /net/server.lua
parent10c09017ad54825707638483f95f3586a59da86e (diff)
downloadprosody-81287473fc3b61e9ba74216e84ddf1c6d8215b31.tar.gz
prosody-81287473fc3b61e9ba74216e84ddf1c6d8215b31.zip
net.server: Fix some more potential nil handler accesses
Diffstat (limited to 'net/server.lua')
-rw-r--r--net/server.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/server.lua b/net/server.lua
index a5c8e24c..cea2ada3 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -369,7 +369,9 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
end
bufferqueuelen = bufferqueuelen + 1
bufferqueue[ bufferqueuelen ] = data
- _writetimes[ handler ] = _writetimes[ handler ] or _currenttime
+ if handler then
+ _writetimes[ handler ] = _writetimes[ handler ] or _currenttime
+ end
return true
end
handler.write = write
@@ -470,7 +472,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
out_put( "server.lua: client ", ip, ":", clientport, " error: ", err )
fatalerror = true
disconnect( handler, err )
- handler.close( )
+ _ = handler and handler.close( )
return false
end
end