summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-13 14:30:55 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-13 14:30:55 +0000
commitd3bcd981d1dee695726c0d09376971b6d95309dd (patch)
tree9a358fe3376fcdcebd41da7617f19a9d7769e804 /lib/rbot
parentd1717e487f9781dfc2eca55fd006191ca55725aa (diff)
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}}}
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/ircsocket.rb8
1 files changed, 5 insertions, 3 deletions
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