fix npe in ManagedLedgerImpl
@@ -3252,9 +3252,11 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
totalEntriesInCurrentLedger = 0;
}
} else {
- totalEntriesInCurrentLedger = ledgers.get(currentLedgerId).getEntries();
+ LedgerInfo ledgerInfo = ledgers.get(currentLedgerId);
+ totalEntriesInCurrentLedger = ledgerInfo != null ? ledgerInfo.getEntries() : 0;
}
+
long unreadEntriesInCurrentLedger = totalEntriesInCurrentLedger - currentEntryId;
if (unreadEntriesInCurrentLedger >= entriesToSkip) {
