From b6c2b380b4b1a28fea163f6bdcda3feb7b486208 Mon Sep 17 00:00:00 2001 From: GyroGearl00se Date: Sat, 20 Jul 2024 23:34:46 +0200 Subject: [PATCH] allow to publish message without payload --- Services/SolacePublishService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Services/SolacePublishService.cs b/Services/SolacePublishService.cs index da0d34f..53a6ae3 100644 --- a/Services/SolacePublishService.cs +++ b/Services/SolacePublishService.cs @@ -50,7 +50,10 @@ public void PublishMessage(string host, string vpnName, string username, string using (IMessage msg = ContextFactory.Instance.CreateMessage()) { msg.Destination = ContextFactory.Instance.CreateTopic(topic); - msg.BinaryAttachment = Encoding.UTF8.GetBytes(message); + if (!String.IsNullOrEmpty(message)) + { + msg.BinaryAttachment = Encoding.UTF8.GetBytes(message); + } _session.Send(msg); } }