Skip to content

Commit

Permalink
Only call client.ref if it exists. Fixes #2582
Browse files Browse the repository at this point in the history
  • Loading branch information
brianc committed Jul 27, 2021
1 parent f3b0ee4 commit 74babd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/pg-pool/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class Pool extends EventEmitter {
const idleItem = this._idle.pop()
clearTimeout(idleItem.timeoutId)
const client = idleItem.client
client.ref()
client.ref && client.ref()
const idleListener = idleItem.idleListener

return this._acquireClient(client, pendingItem, idleListener, false)
Expand Down

0 comments on commit 74babd3

Please sign in to comment.