Skip to content

TypeError: 'NoneType' object is not iterable #3987

@ananthanarayanan-28

Description

@ananthanarayanan-28

Idea about my use case
I'm building the report generation system using google-ask (1.18.0) and building multiple subagents here, I'm passing the one subagent Agent as a tool to another Parent Agent. Note: Sub-agent can do web search.
here, parent agent triggers multiple sub-agent (same agent) multiple times according to use case or complexity of the user input

Describe the bug
here, the bug sometimes sub agents doesn't provide the proper output and resulted in the

merged_text = '\n'.join(p.text for p in last_content.parts if p.text)
^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

and it's breaking the system of Agents workflow

Expected behavior
the Expected behavior is even the sub agents doesn't produce the output (for some reason) there shoudn't be any NoneType error and it is ended up causing the issue in Events stream in the response

Desktop (please complete the following information):

  • OS: [e.g. macOS, Linux, Windows]: MacOS
  • Python version(python -V): 3.12.9
  • ADK version(pip show google-adk): 1.18.0

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-2.5-flash

Additional context - Issue
Add any other context about the problem here.

return await tool.run_async(args=args, tool_context=tool_context)
merged_text = '\n'.join(p.text for p in last_content.parts if p.text)
^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

Metadata

Metadata

Assignees

No one assigned

    Labels

    core[Component] This issue is related to the core interface and implementation

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions