Skip to content

A programming framework for agentic AI

fix: Crash when sending message an agent does not listen to

Jacob Alber7a6f4ded2e21
diff --git a/dotnet/src/Microsoft.AutoGen/Core/BaseAgent.cs b/dotnet/src/Microsoft.AutoGen/Core/BaseAgent.cs
index b94983fd9..201738c16 100644
--- a/dotnet/src/Microsoft.AutoGen/Core/BaseAgent.cs
+++ b/dotnet/src/Microsoft.AutoGen/Core/BaseAgent.cs
@@ -87,10 +87,8 @@ public abstract class BaseAgent : IAgent, IHostableAgent
{
return await handlerInvoker.InvokeAsync(message, messageContext);
}
- else
- {
- throw new InvalidOperationException($"No handler found for message type {messageType.FullName}");
- }
+
+ return null;
}
public virtual ValueTask<IDictionary<string, object>> SaveStateAsync()