Fix the error on non-number priority

The priority is not a number: we consider it 0 as a default
This commit is contained in:
Florent Le Coz 2010-10-17 06:31:05 +08:00 committed by Lance Stout
parent 3625573c7d
commit 93fbcad277

View file

@ -129,7 +129,11 @@ class Presence(RootStanza):
p = self._getSubText('priority') p = self._getSubText('priority')
if not p: if not p:
p = 0 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): def getType(self):
""" """