Compare commits

...
2 Commits
Author SHA1 Message Date
Drew 26df50924b Update to 2.2.9 (#1747) 2016-05-10 10:50:05 -07:00
Drew e698f61a58 Handle null param in cloud code. Fixes #1472 (#1746) 2016-05-10 10:43:02 -07:00
4 changed files with 22 additions and 2 deletions
+4
View File
@@ -1,5 +1,9 @@
## Parse Server Changelog
### 2.2.9 (5/9/2016)
* Fix: Fix a regression that caused Parse Server to crash when a null parameter is passed to a Cloud function
### 2.2.8 (5/8/2016)
* New: Support for Pointer Permissions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "parse-server",
"version": "2.2.8",
"version": "2.2.9",
"description": "An express module providing a Parse-compatible API server",
"main": "lib/index.js",
"repository": {
+16
View File
@@ -1119,6 +1119,22 @@ describe('miscellaneous', function() {
});
});
it('can handle null params in cloud functions (regression test for #1742)', done => {
Parse.Cloud.define('func', (request, response) => {
expect(request.params.nullParam).toEqual(null);
response.success('yay');
});
Parse.Cloud.run('func', {nullParam: null})
.then(() => {
Parse.Cloud._removeHook('Functions', 'func');
done()
}, e => {
fail('cloud code call failed');
done();
});
});
it('fails on invalid client key', done => {
var headers = {
'Content-Type': 'application/octet-stream',
+1 -1
View File
@@ -36,7 +36,7 @@ export class FunctionsRouter extends PromiseRouter {
for (var key in params) {
if (params.hasOwnProperty(key)) {
var value = params[key];
if (value.__type == 'Date') {
if (value && value.__type == 'Date') {
params[key] = new Date(value.iso);
}
}