Skip to content

Commit

Permalink
fix(core): if empty then
Browse files Browse the repository at this point in the history
Fixes #4601
  • Loading branch information
loicmathieu authored and fhussonnois committed Aug 14, 2024
1 parent 654d621 commit d102033
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/io/kestra/plugin/core/flow/If.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.kestra.core.runners.FlowableUtils;
import io.kestra.core.runners.RunContext;
import io.kestra.core.utils.GraphUtils;
import io.kestra.core.utils.ListUtils;
import io.kestra.core.utils.TruthUtils;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -158,7 +159,7 @@ public List<NextTaskRun> resolveNexts(RunContext runContext, Execution execution
@Override
public Optional<State.Type> resolveState(RunContext runContext, Execution execution, TaskRun parentTaskRun) throws IllegalVariableEvaluationException {
List<ResolvedTask> childTask = this.childTasks(runContext, parentTaskRun);
if (childTask == null) {
if (ListUtils.isEmpty(childTask)) {
// no next task to run, we guess the state from the parent task
return Optional.of(execution.guessFinalState(null, parentTaskRun, this.isAllowFailure()));
}
Expand Down

0 comments on commit d102033

Please sign in to comment.