Skip to content

Commit fdc9fad

Browse files
committed
Verify the Pool connection is not nil before attempting to close it
Signed-off-by: Corey Quon <[email protected]>
1 parent bbcde53 commit fdc9fad

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)