Skip to content
Merged
2 changes: 1 addition & 1 deletion src/backend/base/langflow/components/logic/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def evaluate_stop_loop(self) -> bool:
"""Evaluate whether to stop item or done output."""
current_index = self.ctx.get(f"{self._id}_index", 0)
data_length = len(self.ctx.get(f"{self._id}_data", []))
return current_index > data_length
return current_index > max(data_length - 1, 0)

def item_output(self) -> Data:
"""Output the next item in the list or stop if done."""
Expand Down
Loading
Loading