mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
Check nil in defer
A panic might mean that pbr is nil. https://github.com/jackc/pgx/issues/1689
This commit is contained in:
parent
6703484a0d
commit
ef9e26a5d5
2
conn.go
2
conn.go
@ -1064,7 +1064,7 @@ func (c *Conn) sendBatchQueryExecModeDescribeExec(ctx context.Context, b *Batch)
|
||||
func (c *Conn) sendBatchExtendedWithDescription(ctx context.Context, b *Batch, distinctNewQueries []*pgconn.StatementDescription, sdCache stmtcache.Cache) (pbr *pipelineBatchResults) {
|
||||
pipeline := c.pgConn.StartPipeline(context.Background())
|
||||
defer func() {
|
||||
if pbr.err != nil {
|
||||
if pbr != nil && pbr.err != nil {
|
||||
pipeline.Close()
|
||||
}
|
||||
}()
|
||||
|
Loading…
x
Reference in New Issue
Block a user