From 469f9fd2a59cd245b90e9a138e098e14f59a1429 Mon Sep 17 00:00:00 2001 From: Nicholas Wolverson Date: Sun, 13 Aug 2017 21:32:13 +0100 Subject: [PATCH] Check callback for undefined As of 7.0 pg / 2.0 pg-pool the callback is called with `undefined` rather than `null`: https://github.com/brianc/node-pg-pool/blob/master/index.js#L227 --- src/Database/PostgreSQL.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Database/PostgreSQL.js b/src/Database/PostgreSQL.js index 7c7aeff..8fb8061 100644 --- a/src/Database/PostgreSQL.js +++ b/src/Database/PostgreSQL.js @@ -13,7 +13,7 @@ exports.ffiConnect = function(pool) { return function(onSuccess) { return function() { pool.connect(function(err, client, done) { - if (err !== null) { + if (err != null) { onError(err)(); return; } @@ -35,7 +35,7 @@ exports.ffiUnsafeQuery = function(client) { values: values, rowMode: 'array', }, function(err, result) { - if (err !== null) { + if (err != null) { onError(err)(); return; }