From d958df3041e93382c24ed38917e11cc7c44fe100 Mon Sep 17 00:00:00 2001 From: mvarblow Date: Mon, 14 Sep 2015 17:03:30 -0400 Subject: [PATCH] Update TermsPartHandler.cs --- .../Orchard.Taxonomies/Handlers/TermsPartHandler.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 +}