Browse Source

Merge pull request #628 from Zariel/close-nil-pointer

session: connection pool may be nil on close
Chris Bannister 9 năm trước cách đây
mục cha
commit
ce5afa9510
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      session.go

+ 3 - 1
session.go

@@ -248,7 +248,9 @@ func (s *Session) Close() {
 	}
 	s.isClosed = true
 
-	s.pool.Close()
+	if s.pool != nil {
+		s.pool.Close()
+	}
 
 	if s.hostSource != nil {
 		close(s.hostSource.closeChan)