You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static final Builder<List<StreamEntry>> STREAM_ENTRY_LIST = new Builder<List<StreamEntry>>() {
@Override
@SuppressWarnings("unchecked")
public List<StreamEntry> build(Object data) {
if (null == data) {
return null;
}
List<ArrayList<Object>> objectList = (List<ArrayList<Object>>) data;
List<StreamEntry> responses = new ArrayList<>(objectList.size() / 2);
if (objectList.isEmpty()) {
return responses;
}
for (ArrayList<Object> res : objectList) {
if (res == null) {
responses.add(null);
continue;
}
String entryIdString = SafeEncoder.encode((byte[]) res.get(0));
StreamEntryID entryID = new StreamEntryID(entryIdString);
List<byte[]> hash = (List<byte[]>) res.get(1); // hash is null
Iterator<byte[]> hashIterator = hash.iterator();
Map<String, String> map = new HashMap<>(hash.size() / 2);
while (hashIterator.hasNext()) {
map.put(SafeEncoder.encode(hashIterator.next()), SafeEncoder.encode(hashIterator.next()));
}
responses.add(new StreamEntry(entryID, map));
}
return responses;
}
@Override
public String toString() {
return "List<StreamEntry>";
}
};
Expected behavior
xreadGroup should return StreamEntry with empty fields map.
then we can use StreamEntryID, mark ack for pending message (skip it)
Actual behavior
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "hash" is null
at redis.clients.jedis.BuilderFactory$36.build(BuilderFactory.java:802)
at redis.clients.jedis.BuilderFactory$36.build(BuilderFactory.java:779)
at redis.clients.jedis.BuilderFactory$39.build(BuilderFactory.java:872)
at redis.clients.jedis.BuilderFactory$39.build(BuilderFactory.java:860)
at redis.clients.jedis.Jedis.xreadGroup(Jedis.java:4592)
Jedis version:
3.7.1
Java version:
17.0.3
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
use jedis, will produce NPE
NPE at
Expected behavior
xreadGroup should return StreamEntry with empty fields map.
then we can use StreamEntryID, mark ack for pending message (skip it)
Actual behavior
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "hash" is null
at redis.clients.jedis.BuilderFactory$36.build(BuilderFactory.java:802)
at redis.clients.jedis.BuilderFactory$36.build(BuilderFactory.java:779)
at redis.clients.jedis.BuilderFactory$39.build(BuilderFactory.java:872)
at redis.clients.jedis.BuilderFactory$39.build(BuilderFactory.java:860)
at redis.clients.jedis.Jedis.xreadGroup(Jedis.java:4592)
Jedis version:
3.7.1
Java version:
17.0.3
The text was updated successfully, but these errors were encountered: