Fix edge case crash
This commit is contained in:
parent
f13d706686
commit
2235f8b8ed
@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"irc"
|
irc "github.com/thoj/Go-IRC-Client-Library"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
3
irc.go
3
irc.go
@ -58,6 +58,9 @@ func reader(irc *IRCConnection) {
|
|||||||
func writer(irc *IRCConnection) {
|
func writer(irc *IRCConnection) {
|
||||||
for {
|
for {
|
||||||
b := []byte(<-irc.pwrite)
|
b := []byte(<-irc.pwrite)
|
||||||
|
if b == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
_, err := irc.socket.Write(b)
|
_, err := irc.socket.Write(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("%s\n", err)
|
fmt.Printf("%s\n", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user