Cloud function fails if request.params has null parameter
Check out https://github.com/ParsePlatform/parse-server/issues/1271 for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!
Many members of the community use Stack Overflow and Server Fault to ask questions. Read through the existing questions or ask your own!
- Stack Overflow: http://stackoverflow.com/questions/tagged/parse.com
- Server Fault: https://serverfault.com/tags/parse
For database migration help, please file a bug report at https://parse.com/help#report
Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!
- [ x] You've met the prerequisites: https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide#prerequisites.
- [ x] You're running the latest version of Parse Server: https://github.com/ParsePlatform/parse-server/releases
- [ x] You've searched through existing issues: https://github.com/ParsePlatform/Parse-Server/issues?utf8=%E2%9C%93&q=is%3Aissue Chances are that your issue has been reported or resolved before.
Environment Setup
- Server: parse-server version 2.2.8
- Database: MongoDb 3.0.9
Steps to reproduce
run any cloud function with null parameter curl -X POST -H "X-Parse-Application-Id: $appId" -H "Content-Type: application/json;charset=UTF-8" -d '{"notValidVar": null}' 'http://localhost:1337/parse/functions/test'
Logs/Trace
error: Uncaught internal server error. [TypeError: Cannot read property '__type' of null] TypeError: Cannot read property '__type' of null at handleCloudFunction (APPLICATION_PATH/node_modules/parse-server/lib/Routers/FunctionsRouter.js:69:22) at APPLICATION_PATH/node_modules/parse-server/lib/PromiseRouter.js:286:7 at Layer.handle as handle_request at next (APPLICATION_PATH/node_modules/express/lib/router/route.js:131:13) at Route.dispatch (APPLICATION_PATH/node_modules/express/lib/router/route.js:112:3) at Layer.handle as handle_request at APPLICATION_PATH/node_modules/express/lib/router/index.js:277:22 at param (APPLICATION_PATH/node_modules/express/lib/router/index.js:349:14) at param (APPLICATION_PATH/node_modules/express/lib/router/index.js:365:14) at Function.process_params (APPLICATION_PATH/node_modules/express/lib/router/index.js:410:3)
Same issue. I think is associated with this commit https://github.com/ParsePlatform/parse-server/commit/10d2988985c6936fe5027bf30ab1a2195756478a?diff=split
Yep. Working on a fix. We'll do a hotfix later today.
Fixed in 2.2.9