diff --git a/example/test.go b/example/test.go index 4759dbc..7022235 100644 --- a/example/test.go +++ b/example/test.go @@ -1,7 +1,7 @@ package main import ( - "irc" + irc "github.com/thoj/Go-IRC-Client-Library" "fmt" "os" ) diff --git a/irc.go b/irc.go index 981598e..1fb44da 100644 --- a/irc.go +++ b/irc.go @@ -58,6 +58,9 @@ func reader(irc *IRCConnection) { func writer(irc *IRCConnection) { for { b := []byte(<-irc.pwrite) + if b == nil { + return + } _, err := irc.socket.Write(b) if err != nil { fmt.Printf("%s\n", err)