diff --git a/src/smolagents/agents.py b/src/smolagents/agents.py index 468da08c8..626a1c36c 100644 --- a/src/smolagents/agents.py +++ b/src/smolagents/agents.py @@ -510,7 +510,7 @@ def _execute_step(self, memory_step: ActionStep) -> Generator[ChatMessageStreamD yield el elif isinstance(el, FinalOutput): final_answer = el.output - if self.final_answer_checks: + if self.final_answer_checks and final_answer is not None: self._validate_final_answer(final_answer) yield final_answer