From 40cc6aa111d48cff9d1664c831de4f6e3ae49c6d Mon Sep 17 00:00:00 2001 From: Vitaly Tomilov Date: Thu, 20 Jul 2017 11:31:41 +0100 Subject: [PATCH] Update utils.js fixing invalid custom type check --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 166cbddc..352a02fb 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -70,7 +70,7 @@ var prepareValue = function (val, seen) { } function prepareObject (val, seen) { - if (val.toPostgres && typeof val.toPostgres === 'function') { + if (val && typeof val.toPostgres === 'function') { seen = seen || [] if (seen.indexOf(val) !== -1) { throw new Error('circular reference detected while preparing "' + val + '" for query')