Skip to content

Commit

Permalink
Add nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
pboothe committed Oct 21, 2019
1 parent 2f3c7a7 commit 0af22ee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions eventsocket/client.go
Expand Up @@ -59,10 +59,8 @@ func MustRun(ctx context.Context, socket string, handler Handler) {
// conditions. Because Scanner hides the EOF error, it should also hide the
// unexported one. Because Scanner doesn't, we do so here. Other errors
// should not be hidden.
//
// TL;DR: err is non-nil under normal operations. Make it nil in that case.
err = s.Err()
if strings.Contains(err.Error(), "use of closed network connection") {
if err != nil && strings.Contains(err.Error(), "use of closed network connection") {
err = nil
}
rtx.Must(err, "Scanning of %f died with non-EOF error", socket)
Expand Down

0 comments on commit 0af22ee

Please sign in to comment.