From ddc2eaae882df75c33bbd7062bd960f5deebe8d1 Mon Sep 17 00:00:00 2001 From: Drew Gillson Date: Wed, 25 Sep 2024 09:17:59 -0600 Subject: [PATCH] Fix AttributeError: 'NoneType' object has no attribute 'name' (#3127) There is a bug related to the interplay between the society of mind agent and the FileLogger, probably somewhere around https://github.com/microsoft/autogen/blob/main/autogen/agentchat/contrib/society_of_mind_agent.py#L181, which causes an empty name property to be sent. The FileLogger should gracefully handle this circumstance and not return an error to the function caller. Co-authored-by: Chi Wang Co-authored-by: Jack Gerrits --- autogen/logger/file_logger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen/logger/file_logger.py b/autogen/logger/file_logger.py index 37bbbd25a..07c9c3b76 100644 --- a/autogen/logger/file_logger.py +++ b/autogen/logger/file_logger.py @@ -90,7 +90,7 @@ class FileLogger(BaseLogger): thread_id = threading.get_ident() source_name = None if isinstance(source, str): - source_name = source + source_name = getattr(source, "name", "unknown") else: source_name = source.name try: