Skip to content

Commit

Permalink
Fix panic when tailed file does not exist
Browse files Browse the repository at this point in the history
Fixes #17
  • Loading branch information
jwilder committed Jan 25, 2016
1 parent 1bdcc29 commit d5cf86a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ func tailFile(ctx context.Context, file string, poll bool, dest *os.File) {
return
// get the next log line and echo it out
case line := <-t.Lines:
fmt.Fprintln(dest, line.Text)
if line != nil {
fmt.Fprintln(dest, line.Text)
}
}
}
}

0 comments on commit d5cf86a

Please sign in to comment.