Comparing version 7.0.1 to 7.0.2
@@ -403,3 +403,3 @@ 'use strict' | ||
this.connection.stream.destroy(new Error('Connection terminated by user')) | ||
return | ||
return cb ? cb() : Promise.resolve() | ||
} | ||
@@ -406,0 +406,0 @@ if (cb) { |
@@ -53,5 +53,4 @@ 'use strict' | ||
NativeQuery.prototype.handleError = function (err) { | ||
var self = this | ||
// copy pq error fields into the error object | ||
var fields = self.native.pq.resultErrorFields() | ||
var fields = this.native.pq.resultErrorFields() | ||
if (fields) { | ||
@@ -63,8 +62,8 @@ for (var key in fields) { | ||
} | ||
if (self.callback) { | ||
self.callback(err) | ||
if (this.callback) { | ||
this.callback(err) | ||
} else { | ||
self.emit('error', err) | ||
this.emit('error', err) | ||
} | ||
self.state = 'error' | ||
this.state = 'error' | ||
} | ||
@@ -71,0 +70,0 @@ |
@@ -73,3 +73,3 @@ 'use strict' | ||
function prepareObject (val, seen) { | ||
if (val.toPostgres && typeof val.toPostgres === 'function') { | ||
if (val && typeof val.toPostgres === 'function') { | ||
seen = seen || [] | ||
@@ -76,0 +76,0 @@ if (seen.indexOf(val) !== -1) { |
{ | ||
"name": "pg", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"description": "PostgreSQL client - pure javascript & libpq with the same API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82887
1940