mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
Fix NullRefException when cancelling the server.
This commit is contained in:
@@ -170,6 +170,11 @@ namespace MQTTnet.Server
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var enqueuedApplicationMessage = _messageQueue.Take(cancellationToken);
|
||||
|
||||
var sender = enqueuedApplicationMessage.Sender;
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
using MQTTnet.Diagnostics;
|
||||
using MQTTnet.Extensions.ManagedClient;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user