Update utils.js

fixing invalid custom type check
This commit is contained in:
Vitaly Tomilov 2017-07-20 11:31:41 +01:00 committed by Brian C
parent 66c6776f6e
commit 40cc6aa111

View File

@ -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')