From 88efdc361c04711cb528bdc8b3a4022335fe4488 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Fri, 9 Dec 2022 12:52:00 +0100 Subject: [PATCH] fix: Only add a element when specified --- packages/moxxmpp/lib/src/message.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/moxxmpp/lib/src/message.dart b/packages/moxxmpp/lib/src/message.dart index 43b3794..9c09cde 100644 --- a/packages/moxxmpp/lib/src/message.dart +++ b/packages/moxxmpp/lib/src/message.dart @@ -186,9 +186,11 @@ class MessageManager extends XmppManagerBase { body = details.messageRetraction!.fallback; } - stanza.addChild( - XMLNode(tag: 'body', text: body), - ); + if (body != null) { + stanza.addChild( + XMLNode(tag: 'body', text: body), + ); + } } if (details.requestDeliveryReceipt) {