Check for closed channel in writer to avoid throw/crash

This commit is contained in:
tj 2010-10-18 21:34:07 +02:00
parent 6f170547d3
commit 8b8321be96

2
irc.go
View File

@ -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