-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ParameterBindingJsonReader
fails with NPE when a bindable value for ObjectId
parameter is null
#4282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
sounds like a bug - thanks for reporting - we'll look into it! |
I opened a pull request that throws an exception with a good message in cases when a bindable value for string parameters is null |
thanks @Matin69! |
After having a 2nd look at the issue I do think that |
…xtendedJson This commit makes sure to return null for a null parameter value avoiding a potential NPE when parsing data. In doing so we can ensure object creation is done with the intended value that may or may not lead to a downstream error eg. when trying to create an ObjectId with a null hexString. Closes: #4282
ParameterBindingJsonReader
fails with NPE when a bindable value for ObjectId
parameter is null
…ExtendedJson`. This commit makes sure to return null for a null parameter value avoiding a potential NPE when parsing data. In doing so we can ensure object creation is done with the intended value that may or may not lead to a downstream error eg. when trying to create an ObjectId with a null hexString. Closes: #4282 Original pull request: #4334
In JSON queries when you have a nullable value for an object id parameter, A null pointer exception will be thrown. It may seem reasonable but it's not suitable for a case where you want to implement a search function using nullable parameter values. If the value is null you expect null to be replaced with object id.
My case :
The exception :
At least a better exception with a good message should be thrown because it takes some time for me to find out the exception reason
The text was updated successfully, but these errors were encountered: