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.
This commit is contained in:
kesavkolla 2014-12-11 12:10:14 +05:30
parent 8eb2e5d778
commit 81d125fe18

View File

@ -313,7 +313,9 @@ Client.prototype.query = function(config, values, callback) {
if(this.binary && !query.binary) {
query.binary = true;
}
query._result._getTypeParser = this._types.getTypeParser.bind(this._types);
if(query._result) {
query._result._getTypeParser = this._types.getTypeParser.bind(this._types);
}
this.queryQueue.push(query);
this._pulseQueryQueue();