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

Fix NPE in empty XPENDING summary #3792

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/redis/clients/jedis/BuilderFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,11 @@

List<Object> objectList = (List<Object>) data;
long total = BuilderFactory.LONG.build(objectList.get(0));

if (total == 0) {
return new StreamPendingSummary(total, null, null, null);

Check warning on line 1818 in src/main/java/redis/clients/jedis/BuilderFactory.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/redis/clients/jedis/BuilderFactory.java#L1818

Added line #L1818 was not covered by tests
Copy link
Collaborator

Choose a reason for hiding this comment

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

We just don't return null on our own.
We return null or whatever only after reading it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Check #3793

}

String minId = SafeEncoder.encode((byte[]) objectList.get(1));
String maxId = SafeEncoder.encode((byte[]) objectList.get(2));
List<List<Object>> consumerObjList = (List<List<Object>>) objectList.get(3);
Expand Down
Loading