summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-14 12:29:59 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-14 12:29:59 +0000
commit38c2bf2ba44e48d5297c6bdf052c1cdfc50bcb9b (patch)
tree3d869bbcabae04bc9f0d048bac7e6fc467c714e1
parent1dd9c6570e4ef2b08523e8545d41c97830459624 (diff)
downloadpykolab-38c2bf2ba44e48d5297c6bdf052c1cdfc50bcb9b.tar.gz
Fix issuing len() on a possible None
-rw-r--r--pykolab/cli/sieve/cmd_refresh.py4
-rw-r--r--pykolab/plugins/sievemgmt/__init__.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/pykolab/cli/sieve/cmd_refresh.py b/pykolab/cli/sieve/cmd_refresh.py
index 77eecc5..226fb93 100644
--- a/pykolab/cli/sieve/cmd_refresh.py
+++ b/pykolab/cli/sieve/cmd_refresh.py
@@ -258,7 +258,7 @@ def execute(*args, **kw):
mgmt_script.require(required_extension)
if vacation_active:
- if len(vacation_react_domains) > 0:
+ if not vacation_react_domains == None and len(vacation_react_domains) > 0:
mgmt_script.addfilter(
'vacation',
[('envelope', ':domain', ":is", "from", vacation_react_domains)],
@@ -275,7 +275,7 @@ def execute(*args, **kw):
]
)
- elif len(vacation_noreact_domains) > 0:
+ elif not vacation_noreact_domains == None and len(vacation_noreact_domains) > 0:
mgmt_script.addfilter(
'vacation',
[('not', ('envelope', ':domain', ":is", "from", vacation_noreact_domains))],
diff --git a/pykolab/plugins/sievemgmt/__init__.py b/pykolab/plugins/sievemgmt/__init__.py
index f341eae..1e22a47 100644
--- a/pykolab/plugins/sievemgmt/__init__.py
+++ b/pykolab/plugins/sievemgmt/__init__.py
@@ -271,7 +271,7 @@ class KolabSievemgmt(object):
mgmt_script.require(required_extension)
if vacation_active:
- if len(vacation_react_domains) > 0:
+ if not vacation_react_domains == None and len(vacation_react_domains) > 0:
mgmt_script.addfilter(
'vacation',
[('envelope', ':domain', ":is", "from", vacation_react_domains)],
@@ -288,7 +288,7 @@ class KolabSievemgmt(object):
]
)
- elif len(vacation_noreact_domains) > 0:
+ elif not vacation_noreact_domains == None and len(vacation_noreact_domains) > 0:
mgmt_script.addfilter(
'vacation',
[('not', ('envelope', ':domain', ":is", "from", vacation_noreact_domains))],