Skip to content

Commit 9371958

Browse files
dplewisflovilmart
authored andcommitted
Postgres: Properly handle undefined field values (#4186)
Prevents `UnhandledPromiseRejectionWarning: Unhandled promise rejection` when building queries.
1 parent cf630ba commit 9371958

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

spec/ParseACL.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,6 @@ describe('Parse.ACL', () => {
12481248
var user = req.object;
12491249
var acl = new Parse.ACL(user);
12501250
user.setACL(acl);
1251-
console.log('IN AFTER SAVE!');
12521251
user.save(null, {useMasterKey: true}).then(user => {
12531252
new Parse.Query('_User').get(user.objectId).then(() => {
12541253
fail('should not have fetched user without public read enabled');

src/Adapters/Storage/Postgres/PostgresStorageAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ const buildWhereClause = ({ schema, query, index }) => {
235235
patterns.push(`${name} = '${fieldValue}'`);
236236
}
237237
}
238-
} else if (fieldValue === null) {
238+
} else if (fieldValue === null || fieldValue === undefined) {
239239
patterns.push(`$${index}:name IS NULL`);
240240
values.push(fieldName);
241241
index += 1;

0 commit comments

Comments
 (0)