mattisonchao commented on code in PR #19035:
URL: https://github.com/apache/pulsar/pull/19035#discussion_r1058704911
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpReadEntry.java:
##########
@@ -72,13 +76,19 @@ public void readEntriesComplete(List<Entry>
returnedEntries, Object ctx) {
}
cursor.updateReadStats(entriesCount, entriesSize);
- final PositionImpl lastPosition = (PositionImpl)
returnedEntries.get(entriesCount - 1).getPosition();
+ if (lastPosition == null || entriesCount != 0) {
Review Comment:
How about `lastPosition == null` && `entriesCount == 0`? potential NPE?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]