Skip to content
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

[FLINK-35234][hotfix][cdc-common] Fix NullPointerException of org.apache.flink.cdc.common.configuration.ConfigurationUtils#convertToString #3255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

loserwang1024
Copy link
Contributor

Fix exception like this:

Caused by: java.lang.NullPointerException    at org.apache.flink.cdc.common.configuration.ConfigurationUtils.convertToString(ConfigurationUtils.java:133) ~[?:?]    at org.apache.flink.cdc.common.configuration.Configuration.toMap(Configuration.java:138) ~[?:?] 

@loserwang1024
Copy link
Contributor Author

@yuxiqian , @PatrickRen , a mirror fix, CC

@@ -130,7 +130,9 @@ static Duration convertToDuration(Object o) {
}

static String convertToString(Object o) {
if (o.getClass() == String.class) {
if (o == null) {
Copy link
Contributor

@yuxiqian yuxiqian Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can bring the check to convertValue function? Seems other convertToXXX functions also have this problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, just done it.

…che.flink.cdc.common.configuration.ConfigurationUtils
Copy link
Contributor

@yuxiqian yuxiqian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for @loserwang1024's patch, LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants