fix xml when type or timeout is unset
authorMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Wed, 16 Sep 2009 10:56:52 +0000 (10:56 +0000)
committerMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Wed, 16 Sep 2009 10:56:52 +0000 (10:56 +0000)
webinterface/src/WebComponents/Sources/Message.py

index 6033a5f..4785c2c 100644 (file)
@@ -33,7 +33,7 @@ class Message(Source):
 
                try:
                        typeint = int(self.cmd['type'])
-               except ValueError, e:
+               except (ValueError, TypeError), e:
                        return ( False, "type %s is not a number" % self.cmd['type'] )
 
                if typeint == MessageBox.TYPE_YESNO:
@@ -50,7 +50,7 @@ class Message(Source):
 
                try:
                        mtimeout = int(self.cmd['timeout'])
-               except ValueError, e:
+               except (ValueError, TypeError), e:
                        mtimeout = -1
 
                if typeint == MessageBox.TYPE_YESNO: