Skip to content

Commit

Permalink
fix nullpointer on getState()
Browse files Browse the repository at this point in the history
  • Loading branch information
SzyWilliam committed May 29, 2024
1 parent 9c8b7b8 commit cd467d9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,7 @@ CompletableFuture<Message> applyLogToStateMachine(ReferenceCountedObject<LogEntr
void notifyTruncatedLogEntry(LogEntryProto logEntry) {
if (logEntry.hasStateMachineLogEntry()) {
getTransactionManager().remove(TermIndex.valueOf(logEntry));
getState().truncate(logEntry.getIndex());
Optional.ofNullable(getState()).ifPresent(s -> s.truncate(logEntry.getIndex()));

final ClientInvocationId invocationId = ClientInvocationId.valueOf(logEntry.getStateMachineLogEntry());
final CacheEntry cacheEntry = getRetryCache().getIfPresent(invocationId);
Expand Down

0 comments on commit cd467d9

Please sign in to comment.