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 <wang.chi@microsoft.com>
Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
This commit is contained in:
Drew Gillson 2024-09-25 09:17:59 -06:00 committed by GitHub
parent ece69249e4
commit ddc2eaae88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: