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

@@ -1248,7 +1248,6 @@ describe('Parse.ACL', () => {
var user = req.object;
var acl = new Parse.ACL(user);
user.setACL(acl);
console.log('IN AFTER SAVE!');
user.save(null, {useMasterKey: true}).then(user => {
new Parse.Query('_User').get(user.objectId).then(() => {
fail('should not have fetched user without public read enabled');

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;