Skip to content

Commit 919359e

Browse files
committed
Workaround for postgres sometimes sending CopyData after CopyDone
1 parent 318ecb3 commit 919359e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/connection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,11 +855,11 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
855855
}
856856

857857
function CopyData(x) {
858-
stream.push(x.subarray(5)) || socket.pause()
858+
stream && (stream.push(x.subarray(5)) || socket.pause())
859859
}
860860

861861
function CopyDone() {
862-
stream.push(null)
862+
stream && stream.push(null)
863863
stream = null
864864
}
865865

0 commit comments

Comments
 (0)