From ad1c198e435385e9dde4586dd3abea16900bfc6b Mon Sep 17 00:00:00 2001 From: Johan x Lindqvist Date: Thu, 12 Sep 2019 09:05:08 +0200 Subject: [PATCH] Remove if clause that stopped handling of tasks with exceptions. Now the task is always awaited and thus the exception in the task is handled. --- Source/MQTTnet/Client/MqttClient.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Source/MQTTnet/Client/MqttClient.cs b/Source/MQTTnet/Client/MqttClient.cs index 27b56ff..68045a2 100644 --- a/Source/MQTTnet/Client/MqttClient.cs +++ b/Source/MQTTnet/Client/MqttClient.cs @@ -149,7 +149,7 @@ namespace MQTTnet.Client Properties = new MqttAuthPacketProperties { // This must always be equal to the value from the CONNECT packet. So we use it here to ensure that. - AuthenticationMethod = Options.AuthenticationMethod, + AuthenticationMethod = Options.AuthenticationMethod, AuthenticationData = data.AuthenticationData, ReasonString = data.ReasonString, UserProperties = data.UserProperties @@ -567,7 +567,7 @@ namespace MQTTnet.Client }; await SendAsync(pubRecPacket, cancellationToken).ConfigureAwait(false); - } + } } else { @@ -633,11 +633,6 @@ namespace MQTTnet.Client return; } - if (task.IsCanceled || task.IsCompleted || task.IsFaulted) - { - return; - } - try { await task.ConfigureAwait(false);