diff --git a/Source/MQTTnet/Formatter/V5/MqttV5PropertiesWriter.cs b/Source/MQTTnet/Formatter/V5/MqttV5PropertiesWriter.cs index 3307b661..6b274bba 100644 --- a/Source/MQTTnet/Formatter/V5/MqttV5PropertiesWriter.cs +++ b/Source/MQTTnet/Formatter/V5/MqttV5PropertiesWriter.cs @@ -84,6 +84,11 @@ namespace MQTTnet.Formatter.V5 { // If absent, the Application Message does not expire. // This library uses 0 to indicate no expiration. + if (value == 0) + { + return; + } + WriteAsFourByteInteger(MqttPropertyId.MessageExpiryInterval, value); }