From 7b634184a27d3be3d6a664b6622e6d446f54f18d Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 13 Jul 2006 14:31:24 +0000 Subject: ircbot shouldn't issue {{{@socket}}} commands when disconnected --- lib/rbot/ircbot.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/rbot/ircbot.rb') diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 0cfc3f12..aebb7db4 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -490,12 +490,14 @@ class IrcBot # @registry.close debug "Cleaning up the db environment" DBTree.cleanup_env - debug "Sending quit message" - @socket.puts "QUIT :#{message}" - debug "Flushing socket" - @socket.flush - debug "Shutting down socket" - @socket.shutdown + if @socket.connected? + debug "Sending quit message" + @socket.puts "QUIT :#{message}" + debug "Flushing socket" + @socket.flush + debug "Shutting down socket" + @socket.shutdown + end puts "rbot quit (#{message})" end -- cgit v1.2.3