Skip to content

Commit 81d125f

Browse files
committed
Making a conditional check for type parser
The code is failing with pg-copy-streams. The pg-copy-streams creates a query object but it doesn't have any _result. Make the type parser an optional only when _result object available on query then only set the type parser.
1 parent 8eb2e5d commit 81d125f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/client.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ Client.prototype.query = function(config, values, callback) {
313313
if(this.binary && !query.binary) {
314314
query.binary = true;
315315
}
316-
query._result._getTypeParser = this._types.getTypeParser.bind(this._types);
316+
if(query._result) {
317+
query._result._getTypeParser = this._types.getTypeParser.bind(this._types);
318+
}
317319

318320
this.queryQueue.push(query);
319321
this._pulseQueryQueue();

0 commit comments

Comments
 (0)