diff --git a/src/Infrastructure/BotSharp.Core/Instructs/InstructService.cs b/src/Infrastructure/BotSharp.Core/Instructs/InstructService.cs index 3718e1fe..bb328753 100644 --- a/src/Infrastructure/BotSharp.Core/Instructs/InstructService.cs +++ b/src/Infrastructure/BotSharp.Core/Instructs/InstructService.cs @@ -21,7 +21,7 @@ public partial class InstructService : IInstructService var hooks = _services.GetServices(); foreach (var hook in hooks) { - if (hook.SelfId != agent.Id) + if (!string.IsNullOrEmpty(hook.SelfId) && hook.SelfId != agent.Id) { continue; } @@ -47,7 +47,7 @@ public partial class InstructService : IInstructService foreach (var hook in hooks) { - if (hook.SelfId != agent.Id) + if (!string.IsNullOrEmpty(hook.SelfId) && hook.SelfId != agent.Id) { continue; }