diff options
author | Florent Le Coz <louiz@louiz.org> | 2010-10-17 06:31:05 +0800 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-10-17 09:01:53 +0800 |
commit | 93fbcad2777cb853ec9f4e7132c078e503bba2f4 (patch) | |
tree | 289b5b05a6a99c9e774d7db8cf25db170303e2c2 /sleekxmpp | |
parent | 3625573c7d071db17beeeb84631fa082bdaf808a (diff) | |
download | slixmpp-93fbcad2777cb853ec9f4e7132c078e503bba2f4.tar.gz slixmpp-93fbcad2777cb853ec9f4e7132c078e503bba2f4.tar.bz2 slixmpp-93fbcad2777cb853ec9f4e7132c078e503bba2f4.tar.xz slixmpp-93fbcad2777cb853ec9f4e7132c078e503bba2f4.zip |
Fix the error on non-number priority
The priority is not a number: we consider it 0 as a default
Diffstat (limited to 'sleekxmpp')
-rw-r--r-- | sleekxmpp/stanza/presence.py | 6 |
1 files changed, 5 insertions, 1 deletions
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): """ |