Skip to content

Commit

Permalink
Merge pull request #480 from cquon/fix_connpool_close
Browse files Browse the repository at this point in the history
Verify the Pool connection is not nil before attempting to close it
  • Loading branch information
CMogilko authored Mar 12, 2020
2 parents bbcde53 + fdc9fad commit c38c1ce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ func (p *Pool) Close() error {
p.closed = poolIsClosed

for _, c := range p.conns {
err := c.Close()
if err != nil {
return err
if c != nil {
err := c.Close()
if err != nil {
return err
}
}
}

Expand Down

0 comments on commit c38c1ce

Please sign in to comment.