diff --git a/PurpleExplorer/Models/Message.cs b/PurpleExplorer/Models/Message.cs index 951c430..39f23d4 100644 --- a/PurpleExplorer/Models/Message.cs +++ b/PurpleExplorer/Models/Message.cs @@ -1,6 +1,5 @@ using System; using System.Text; -using Microsoft.Azure.ServiceBus; using AzureMessage = Microsoft.Azure.ServiceBus.Message; namespace PurpleExplorer.Models @@ -22,7 +21,7 @@ public class Message public Message(AzureMessage azureMessage, bool isDlq) { - this.Content = Encoding.UTF8.GetString(azureMessage.Body); + this.Content = azureMessage.Body is not null ? Encoding.UTF8.GetString(azureMessage.Body) : string.Empty; this.MessageId = azureMessage.MessageId; this.CorrelationId = azureMessage.CorrelationId; this.DeliveryCount = azureMessage.SystemProperties.DeliveryCount;