Check for closed channel in writer to avoid throw/crash
This commit is contained in:
parent
6f170547d3
commit
8b8321be96
2
irc.go
2
irc.go
@ -59,7 +59,7 @@ func reader(irc *IRCConnection) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func writer(irc *IRCConnection) {
|
func writer(irc *IRCConnection) {
|
||||||
for !error {
|
for !error && ! closed(irc.pwrite) {
|
||||||
b := []byte(<-irc.pwrite)
|
b := []byte(<-irc.pwrite)
|
||||||
if b == nil || irc.socket == nil {
|
if b == nil || irc.socket == nil {
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user