Don't match unset args
authorKonstantin Stepanov <kstep@p-nut.info>
Mon, 18 Oct 2010 14:51:09 +0000 (17:51 +0300)
committerKonstantin Stepanov <kstep@p-nut.info>
Mon, 18 Oct 2010 14:51:09 +0000 (17:51 +0300)
dbuscron/bus.py

index 33dfa31..c766860 100644 (file)
@@ -97,12 +97,13 @@ class DbusRule(object):
         if self._destination not in (None, message.get_destination()):
             return False
 
-        args_ = message.get_args_list()
-        for i, arg in enumerate(args_):
-            if i >= len(self._args):
-                break
-            if self._args[i] not in (None, arg):
-                return False
+        if self._args is not None:
+            args_ = message.get_args_list()
+            for i, arg in enumerate(args_):
+                if i >= len(self._args):
+                    break
+                if self._args[i] not in (None, arg):
+                    return False
 
         return True