From 2e81f2bcdf699c0ca92fbd3089eeb891c37e4ee8 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Thu, 19 Oct 2017 22:20:20 +0800 Subject: [PATCH] add determines whether the query is null. --- src/DotNetCore.CAP/IQueueExecutor.Subscribe.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/DotNetCore.CAP/IQueueExecutor.Subscribe.cs b/src/DotNetCore.CAP/IQueueExecutor.Subscribe.cs index e6ff3a4..b264426 100644 --- a/src/DotNetCore.CAP/IQueueExecutor.Subscribe.cs +++ b/src/DotNetCore.CAP/IQueueExecutor.Subscribe.cs @@ -32,6 +32,13 @@ namespace DotNetCore.CAP public async Task ExecuteAsync(IStorageConnection connection, IFetchedMessage fetched) { var message = await connection.GetReceivedMessageAsync(fetched.MessageId); + + if (message == null) + { + _logger.LogError($"Can not find mesage at cap received message table, message id:{fetched.MessageId} !!!"); + return OperateResult.Failed(); + } + try { var sp = Stopwatch.StartNew();