Skip to content

Commit f682ca1

Browse files
committed
Fix destroy before connected
1 parent 0f08fb9 commit f682ca1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/connection.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ function Connection(options = {}) {
1818
onnotice,
1919
parsers
2020
} = options
21-
2221
let buffer = Buffer.alloc(0)
2322
let length = 0
2423
let messages = []
@@ -230,7 +229,7 @@ function postgresSocket(options, {
230229
ready: false,
231230
write: x => socket.write(x),
232231
destroy: () => {
233-
socket.destroy()
232+
socket && socket.destroy()
234233
return Promise.resolve()
235234
},
236235
end: () => {

0 commit comments

Comments
 (0)