lib/potato/irc/server.rb in potato-0.0.12 vs lib/potato/irc/server.rb in potato-0.0.13
- old
+ new
@@ -61,10 +61,15 @@
cl.notice "Lost connection to dAmn (#{e.class})."
cl.socket.close
end
@connections = {}
end
- debug pkt.raw, :damn
+ unless pkt.nil?
+ debug pkt.raw, :damn
+ else
+ cl.notice "Lost connection to dAmn (server closed connection)."
+ cl.socket.close
+ end
client = @connections.values.find{|x|x.client.server == action}.client
client.send("on_#{pkt.cmd}".to_sym, pkt) if client.respond_to?("on_#{pkt.cmd}".to_sym)
else
if action.eof?
@connections.delete(action)
\ No newline at end of file