Skip to content

Commit 6bc9c9f

Browse files
google-genai-botcopybara-github
authored andcommitted
fix: guard user_content assignment against None in EvaluationGenerator
PiperOrigin-RevId: 935770639
1 parent c08debc commit 6bc9c9f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/google/adk/evaluation/evaluation_generator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,9 @@ def convert_events_to_eval_invocations(
653653
if current_author == _USER_AUTHOR:
654654
# If the author is the user, then we just identify it and move on
655655
# to the next event.
656-
user_content = event.content
657-
invocation_timestamp = event.timestamp
656+
if event.content is not None:
657+
user_content = event.content
658+
invocation_timestamp = event.timestamp
658659
continue
659660

660661
if event.content and event.content.parts:

0 commit comments

Comments
 (0)