-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Calling a method on an ConsumerRecords before performing a null check #3810
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
Labels
Comments
I think it's ok to move that logging after the conditional statement. Feel free to send a PR. Thanks! |
ghgh415263
added a commit
to ghgh415263/spring-kafka
that referenced
this issue
Mar 19, 2025
Move the logging statement after the conditional statement. Signed-off-by: kjy1994 <[email protected]>
Thank you for the review I just sent the PR
|
sobychacko
pushed a commit
that referenced
this issue
Mar 19, 2025
…n KafkaTestUtils (#3811) Fixes: 3810 Issue link: #3810 Signed-off-by: kjy1994 <[email protected]> **Auto-cherry-pick to `3.3.x` & `3.2.x`**
spring-builds
pushed a commit
that referenced
this issue
Mar 19, 2025
…n KafkaTestUtils (#3811) Fixes: 3810 Issue link: #3810 Signed-off-by: kjy1994 <[email protected]> (cherry picked from commit e85c88c)
spring-builds
pushed a commit
that referenced
this issue
Mar 19, 2025
…n KafkaTestUtils (#3811) Fixes: 3810 Issue link: #3810 Signed-off-by: kjy1994 <[email protected]> (cherry picked from commit e85c88c)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In what version(s) of Spring for Apache Kafka are you seeing this issue?
current main branch
Describe the bug
KafkaTestUtils.java
If received can be null, a NullPointerException may occur in the logger received.count(). (line 371)
But, as far as I know, 'consumer.poll method' does not return null.
How about moving it right below line 370 or removing it?
I appreciate you taking the time to read this
To Reproduce
Steps to reproduce the behavior.
Expected behavior
A clear and concise description of what you expected to happen.
Sample
A link to a GitHub repository with a minimal, reproducible, sample.
Reports that include a sample will take priority over reports that do not.
At times, we may require a sample, so it is good to try and include a sample up front.
The text was updated successfully, but these errors were encountered: