Skip to content

Commit e9cb296

Browse files
committed
Bugfix: safe call of .hasOwnProperty(...)
1 parent c126ba1 commit e9cb296

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ PG.prototype.cancel = function(config, client, query) {
5252
cancellingClient.cancel(client, query);
5353
};
5454

55-
if (process.env.hasOwnProperty('NODE_PG_FORCE_NATIVE')) {
55+
var forceNative = Object.prototype.hasOwnProperty.call(process.env, 'NODE_PG_FORCE_NATIVE');
56+
if (forceNative) {
5657
module.exports = new PG(require(__dirname + '/native'));
5758
} else {
5859
module.exports = new PG(Client);

0 commit comments

Comments
 (0)