Fix null relation problem (#2319)
* Add null check for relation type map. For relations that are not explicitly defined in the schema, we need a null check here. * Making change to force rebuild. * Reverting change. * Adds test
This commit is contained in:
@@ -2595,5 +2595,22 @@ describe('Parse.User testing', () => {
|
||||
})
|
||||
});
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
it_exclude_dbs(['postgres'])('should not fail querying non existing relations', done => {
|
||||
let user = new Parse.User();
|
||||
user.set({
|
||||
username: 'hello',
|
||||
password: 'world'
|
||||
})
|
||||
user.signUp().then(() => {
|
||||
return Parse.User.current().relation('relation').query().find();
|
||||
}).then((res) => {
|
||||
expect(res.length).toBe(0);
|
||||
done();
|
||||
}).catch((err) => {
|
||||
fail(JSON.stringify(err));
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user