diff --git a/sleekxmpp/stanza/presence.py b/sleekxmpp/stanza/presence.py index 7eb0c5b1..37dfe33c 100644 --- a/sleekxmpp/stanza/presence.py +++ b/sleekxmpp/stanza/presence.py @@ -129,7 +129,11 @@ class Presence(RootStanza): p = self._getSubText('priority') if not p: p = 0 - return int(p) + try: + return int(p) + except ValueError: + # The priority is not a number: we consider it 0 as a default + return 0 def getType(self): """