From 8b8321be965831562a0eab30f350e55e7074381d Mon Sep 17 00:00:00 2001 From: tj Date: Mon, 18 Oct 2010 21:34:07 +0200 Subject: [PATCH] Check for closed channel in writer to avoid throw/crash --- irc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc.go b/irc.go index ee44014..75d7661 100644 --- a/irc.go +++ b/irc.go @@ -59,7 +59,7 @@ func reader(irc *IRCConnection) { } func writer(irc *IRCConnection) { - for !error { + for !error && ! closed(irc.pwrite) { b := []byte(<-irc.pwrite) if b == nil || irc.socket == nil { break