- LOG.info("Found current offset {} for partition {}", entry.getValue(), entry.getKey());
- currentOffsets[entry.getKey().partition()] = entry.getValue().offset() - 1l;
+ if (entry.getValue() == null)
+ {
+ LOG.debug("Found no offset for partition {}", entry.getKey());
+ currentOffsets[entry.getKey().partition()] = -1l;
+ }
+ else
+ {
+ LOG.debug("Found current offset {} for partition {}", entry.getValue(), entry.getKey());
+ currentOffsets[entry.getKey().partition()] = entry.getValue().offset() - 1l;
+ }