-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix NPE caused by null value of SchemaInfo's properties #9985
Fix NPE caused by null value of SchemaInfo's properties #9985
Conversation
I've pushed a PR to fix your issue. But I'm curious about why did you set a property value to |
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/pulsarbot run-failure-checks |
pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
Fixes apache#9964 ### Motivation If there exists a null value of `SchemaInfo`'s properties, NPE will be thrown in `SchemaInfo#toString` or `Commands#newSubscribe`. ### Modifications - Add null checks before `JsonPrimitive`'s constructor, `KeyValue#setKey` and `KeyValue#setValue`. - Add related tests.
Fixes #9964
Motivation
If there exists a null value of
SchemaInfo
's properties, NPE will be thrown inSchemaInfo#toString
orCommands#newSubscribe
.Modifications
JsonPrimitive
's constructor,KeyValue#setKey
andKeyValue#setValue
.Verifying this change
This change added tests and can be verified as follows:
SchemaTest#testNullKeyValueProperty
andSchemaInfoTest#testNullPropertyValue
.