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

[#6523] fix(core): Filter null prop when init properties #6524

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

Conversation

TEOTEO520
Copy link
Contributor

@TEOTEO520 TEOTEO520 commented Feb 25, 2025

What changes were proposed in this pull request?

Filters out any entries with null keys/values before collection, to prevent potential NullPointerExceptions when accessing entries

Why are the changes needed?

Due to the cancellation of the operation to reload the topic to fill in its other properties after the alter operation in #3729, there is a risk that the value of the downstream property may return null, which in turn could trigger a NullPointerException in the properties() method of the Topic class.

Fix: #6523

Does this PR introduce any user-facing change?

no

How was this patch tested?

no need to add test

@jerqi
Copy link
Contributor

jerqi commented Feb 26, 2025

Because this is a bug fix. Could you add a UT to cover this change?

@TEOTEO520
Copy link
Contributor Author

Because this is a bug fix. Could you add a UT to cover this change?

OK

@@ -77,6 +77,7 @@ public String storageLocation() {
public Map<String, String> properties() {
return fileset.properties().entrySet().stream()
.filter(p -> !hiddenProperties.contains(p.getKey()))
.filter(entry -> entry.getKey() != null && entry.getValue() != null)
Copy link
Contributor

Choose a reason for hiding this comment

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

how could entry.getKey() becomes null?

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

Successfully merging this pull request may close these issues.

[Bug report] NullPointerException after alter operation
3 participants