diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Handlers/TermsPartHandler.cs b/src/Orchard.Web/Modules/Orchard.Taxonomies/Handlers/TermsPartHandler.cs index 69d1cf093..b1ea5d2c0 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Handlers/TermsPartHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Handlers/TermsPartHandler.cs @@ -92,8 +92,9 @@ namespace Orchard.Taxonomies.Handlers { // Fires off a processing engine task to run the count processing after the request so it's non-blocking. private void RecalculateCount(IProcessingEngine processingEngine, ShellSettings shellSettings, IShellDescriptorManager shellDescriptorManager, TermsPart part) { var termPartRecordIds = part.Terms.Select(t => t.TermRecord.Id).ToArray(); - processingEngine.AddTask(shellSettings, shellDescriptorManager.GetShellDescriptor(), "ITermCountProcessor.Process", new Dictionary { { "termPartRecordIds", termPartRecordIds } }); - + if (termPartRecordIds.Length > 0) { + processingEngine.AddTask(shellSettings, shellDescriptorManager.GetShellDescriptor(), "ITermCountProcessor.Process", new Dictionary { { "termPartRecordIds", termPartRecordIds } }); + } } protected override void Activating(ActivatingContentContext context) { @@ -113,4 +114,4 @@ namespace Orchard.Taxonomies.Handlers { } } } -} \ No newline at end of file +}