Closed
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest versions of Parse Server and the Parse JS SDK.
Issue Description
This bug was first found in https://github.com/parse-community/parse-server/ (see issue parse-community/parse-server#9766)
In _getRequestOptions
in file ParseObject.js
the parameter options
is set to {}
if it has no value. This works for values like ''
, undefined
or if it is empty, but if it is null
the code breaks.
Steps to reproduce
Call the function Parse.Cloud.run(<name>, data, null);
or _ParseObject.default._getRequestOptions(null);
directly.
Actual Outcome
Error:
TypeError: Cannot convert undefined or null to object
at hasOwn (<anonymous>)
at Function._getRequestOptions (/Users/#################/node_modules/parse/lib/node/ParseObject.js:423:9)
at Object.run (/Users/#################/node_modules/parse/lib/node/Cloud.js:57:47)
…
Expected Outcome
When no options _getRequestOptions
should return {}
Some kind of null check for the parameter options
.
if(!options){
return requestOptions;
}
Environment
I have tested this in 8.2.0
and 8.2.1-alpha.2
. Error occurs in both.
The function does not exists in 7.5.2
Server
- Parse Server version:
8.2.0
- Operating system:
macOS 15.5
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
local
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
macOS 15.5
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
local
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
Node
- SDK version:
22.14.0
Client
- Parse JS SDK version:
6.1.0