Philipp Hörist pushed to branch master at gajim / gajim


Commits:
cc1b0f04 by Philipp Hörist at 2024-06-13T23:16:48+02:00
fix: Migration: Don’t fail on invalid JIDs

Fixes #11862

- - - - -


1 changed file:

- gajim/common/storage/archive/migration.py


Changes:

=====================================
gajim/common/storage/archive/migration.py
=====================================
@@ -363,8 +363,23 @@ def _process_message_row(self, conn: sa.Connection, 
log_row: Logs) -> None:
             )
             return
 
-        account_jid = JID.from_string(log_row.account.jid)
-        remote_jid = JID.from_string(log_row.remote.jid)
+        try:
+            account_jid = JID.from_string(log_row.account.jid)
+        except Exception:
+            log.warning(
+                'Unable to migrate message because of invalid account jid: %s',
+                log_row.account.jid,
+            )
+            return
+
+        try:
+            remote_jid = JID.from_string(log_row.remote.jid)
+        except Exception:
+            log.warning(
+                'Unable to migrate message because of invalid remote jid: %s',
+                log_row.remote.jid,
+            )
+            return
 
         account_pk = self._get_account_pk(conn, account_jid)
         remote_pk = self._get_remote_pk(conn, remote_jid)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/cc1b0f041f2a86874c3e34fae8911d92a7338c17

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/cc1b0f041f2a86874c3e34fae8911d92a7338c17
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to