Skip to content

Commit

Permalink
StateMachineProcedure getCurrentState() return null if state is EOF_S…
Browse files Browse the repository at this point in the history
…TATE (apache#13704)
  • Loading branch information
liyuheng55555 authored Oct 12, 2024
1 parent 6b50f13 commit b9214a5
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.iotdb.confignode.procedure.exception.ProcedureSuspendedException;
import org.apache.iotdb.confignode.procedure.exception.ProcedureYieldException;

import org.apache.thrift.annotation.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -275,8 +276,15 @@ private boolean hasMoreState() {
return stateFlow != Flow.NO_MORE_STATE;
}

@Nullable
protected TState getCurrentState() {
return stateCount > 0 ? getState(states[stateCount - 1]) : getInitialState();
if (stateCount > 0) {
if (states[stateCount - 1] == EOF_STATE) {
return null;
}
return getState(states[stateCount - 1]);
}
return getInitialState();
}

/**
Expand Down

0 comments on commit b9214a5

Please sign in to comment.