Skip to content

Commit

Permalink
fix: check task_outputs length
Browse files Browse the repository at this point in the history
  • Loading branch information
barantaran committed Jan 31, 2025
1 parent ddb7958 commit 225db8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/crewai/crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,8 @@ def _handle_conditional_task(
task_outputs = self._process_async_tasks(futures, was_replayed)
futures.clear()

previous_output = task_outputs[task_index - 1] if task_outputs else None
prev_output_index = task_index - 1 if len(task_outputs) > 1 else 0
previous_output = task_outputs[prev_output_index] if task_outputs else None
if previous_output is not None and not task.should_execute(previous_output):
self._logger.log(
"debug",
Expand Down

0 comments on commit 225db8e

Please sign in to comment.