Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
bead28d6 by wurstsalat at 2024-09-08T23:11:32+02:00
fix: Debug Console: Catch errors before trying to send stanzas

Fixes #11976, #11301

- - - - -


1 changed file:

- gajim/gtk/debug_console.py


Changes:

=====================================
gajim/gtk/debug_console.py
=====================================
@@ -311,8 +311,15 @@ def _on_send(self, *args: Any) -> None:
                 # set jabber:client as toplevel namespace
                 # Use type Protocol so nbxmpp counts the stanza for
                 # stream management
-                node = nbxmpp.Protocol(node=stanza,
-                                       attrs={'xmlns': 'jabber:client'})
+                try:
+                    node = nbxmpp.Protocol(
+                        node=stanza,
+                        attrs={'xmlns': 'jabber:client'}
+                    )
+                except Exception as error:
+                    ErrorDialog(_('Invalid Stanza'), str(error))
+                    return
+
             client = app.get_client(self._selected_send_account)
             assert isinstance(node, nbxmpp.Protocol)
             client.connection.send_stanza(node)



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

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/bead28d6105b97cdf0af52987c1db55eae84019c
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