Skip to content

Commit c38c1ce

Browse files
authored
Merge pull request #480 from cquon/fix_connpool_close
Verify the Pool connection is not nil before attempting to close it
2 parents bbcde53 + fdc9fad commit c38c1ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pool.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ func (p *Pool) Close() error {
8686
p.closed = poolIsClosed
8787

8888
for _, c := range p.conns {
89-
err := c.Close()
90-
if err != nil {
91-
return err
89+
if c != nil {
90+
err := c.Close()
91+
if err != nil {
92+
return err
93+
}
9294
}
9395
}
9496

0 commit comments

Comments
 (0)