Postgres: Properly handle undefined field values (#4186)

Prevents `UnhandledPromiseRejectionWarning: Unhandled promise rejection` when building queries.
This commit is contained in:
Diamond Lewis
2017-09-19 06:59:48 -05:00
committed by Florent Vilmart
parent cf630ba462
commit 9371958a09
2 changed files with 1 additions and 2 deletions

View File

@@ -235,7 +235,7 @@ const buildWhereClause = ({ schema, query, index }) => {
patterns.push(`${name} = '${fieldValue}'`);
}
}
} else if (fieldValue === null) {
} else if (fieldValue === null || fieldValue === undefined) {
patterns.push(`$${index}:name IS NULL`);
values.push(fieldName);
index += 1;