diff --git a/gajim/common/modules/message.py b/gajim/common/modules/message.py
index 016d69e1dada4b4cd092eb7c830f87521edc2914..f7434ccac884caa85776553c426f3a30f73a5a7a 100644
--- a/gajim/common/modules/message.py
+++ b/gajim/common/modules/message.py
@@ -331,6 +331,8 @@ class Message:
 
         if archive.bareMatch(properties.stanza_id.by):
             return properties.stanza_id.id, None
+        # stanza-id not added by the archive, ignore it.
+        return None, None
 
 
 class MessageReceivedEvent(NetworkIncomingEvent):