From d3bcd981d1dee695726c0d09376971b6d95309dd Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 13 Jul 2006 14:30:55 +0000 Subject: Prevent a traceback when network is down and clearq is called. Don't know if it's better this way or by adding an {{{if @socket.connected?}}} at {{{ircbot.rb:373}}} --- lib/rbot/ircsocket.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/rbot/ircsocket.rb b/lib/rbot/ircsocket.rb index 6a5f281a..2f66835f 100644 --- a/lib/rbot/ircsocket.rb +++ b/lib/rbot/ircsocket.rb @@ -164,9 +164,11 @@ module Irc end def clearq - unless @sendq.empty? - @qmutex.synchronize do - @sendq.clear + if @sock + unless @sendq.empty? + @qmutex.synchronize do + @sendq.clear + end end end end -- cgit v1.2.3