diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py
index 3e691b1b91e27d6da6ab1d392d28ff661b81ea25..b64ab4399447449c85729dcb04d26b8c70360709 100644
--- a/src/common/connection_handlers_events.py
+++ b/src/common/connection_handlers_events.py
@@ -1016,7 +1016,8 @@ class MessageReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
                 self.msgtxt = _('error while sending %(message)s ( %(error)s )'\
                     ) % {'message': self.msgtxt,
                     'error': self.stanza.getErrorMsg()}
-                self.stanza.delChild('html')
+                if self.stanza.getTag('html'):
+                    self.stanza.delChild('html')
             # message from a gc without a resource
             self.mtype = 'groupchat'