Put nil checking in correct place.

This commit is contained in:
Alex Bramley 2011-07-27 21:15:09 +01:00
parent 33a5bff35b
commit 900afb5c48
1 changed files with 5 additions and 6 deletions

View File

@ -197,20 +197,19 @@ func (conn *Conn) recv() {
fmt.Println(t.Format(conn.TSFormat) + " <- " + s)
}
line := parseLine(s)
if line := parseLine(s); line != nil {
line.Time = t
conn.in <- line
}
}
}
// goroutine to dispatch events for lines received on input channel
func (conn *Conn) runLoop() {
for {
select {
case line := <-conn.in:
if line != nil {
conn.dispatchEvent(line)
}
case <-conn.cLoop:
// strobe on control channel, bail out
return