From ce07c555b29ee86bfe02e56ab5233257b4eaf873 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Mon, 23 Dec 2019 20:47:27 +0800 Subject: [PATCH] Add empty detection --- .../Internal/IConsumerServiceSelector.Default.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs b/src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs index 7866c5b..f77ed53 100644 --- a/src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs +++ b/src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs @@ -52,6 +52,11 @@ namespace DotNetCore.CAP.Internal public ConsumerExecutorDescriptor SelectBestCandidate(string key, IReadOnlyList executeDescriptor) { + if (executeDescriptor.Count == 0) + { + return null; + } + var result = MatchUsingName(key, executeDescriptor); if (result != null) {