From e4f605fbd5b0daa0bcc21ed2ec35c6ac77a542e5 Mon Sep 17 00:00:00 2001 From: Diego2098 <82756760+kimdiego2098@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:29:19 +0800 Subject: [PATCH] Update MqttServer.cs (#1858) * Update MqttServer.cs clientID is null => RetainedMessageChangedEventArgs ctor throw new ArgumentNullException(nameof(clientId) * Update ReleaseNotes.md --------- Co-authored-by: Christian <6939810+chkr1011@users.noreply.github.com> --- .github/workflows/ReleaseNotes.md | 3 +-- Source/MQTTnet/Server/MqttServer.cs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ReleaseNotes.md b/.github/workflows/ReleaseNotes.md index f1aa2d52..d0afced5 100644 --- a/.github/workflows/ReleaseNotes.md +++ b/.github/workflows/ReleaseNotes.md @@ -1,2 +1 @@ -* [Client] Fixed wrong TLS options handling (#1830). -* [Client] Fixed NullReferenceExeption when performing a Ping when the client is not connected (#1831). +* [Server] Fixed not working _UpdateRetainedMessageAsync_ public api (#1858, thanks to @kimdiego2098) diff --git a/Source/MQTTnet/Server/MqttServer.cs b/Source/MQTTnet/Server/MqttServer.cs index ff6c806e..a28f8256 100644 --- a/Source/MQTTnet/Server/MqttServer.cs +++ b/Source/MQTTnet/Server/MqttServer.cs @@ -362,7 +362,7 @@ namespace MQTTnet.Server ThrowIfDisposed(); ThrowIfNotStarted(); - return _retainedMessagesManager?.UpdateMessage(null, retainedMessage); + return _retainedMessagesManager?.UpdateMessage(string.Empty, retainedMessage); } protected override void Dispose(bool disposing) @@ -405,4 +405,4 @@ namespace MQTTnet.Server } } } -} \ No newline at end of file +}