Skip routing rule check if current agent is empty.

This commit is contained in:
Haiping Chen 2024-03-22 08:24:58 -05:00
parent ed860f3631
commit 3a28a72f6c

View file

@ -106,6 +106,11 @@ public class RoutingContext : IRoutingContext
await hook.OnAgentDequeued(agentId, currentAgentId, reason: reason)
).Wait();
if (string.IsNullOrEmpty(currentAgentId))
{
return;
}
// Run the routing rule
var agency = _services.GetRequiredService<IAgentService>();
var agent = agency.LoadAgent(currentAgentId).Result;