aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2016-06-08 23:35:11 +0200
committerVG <vg@devys.org>2016-06-08 23:35:11 +0200
commit30c21dc7f2f164e4b52940d4b394bfd0ac82df5e (patch)
treeefe22800e5249f48b1d5e4716af12722e2c95687
parent8d1597b10cb49cd54677f7a049afa637cece6134 (diff)
downloadcliml-30c21dc7f2f164e4b52940d4b394bfd0ac82df5e.tar.gz
climl-30c21dc7f2f164e4b52940d4b394bfd0ac82df5e.tar.bz2
climl-30c21dc7f2f164e4b52940d4b394bfd0ac82df5e.zip
add protection if hook returns none
-rw-r--r--climl/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/climl/__init__.py b/climl/__init__.py
index bfbe4fc..147dfc3 100644
--- a/climl/__init__.py
+++ b/climl/__init__.py
@@ -16,7 +16,11 @@ def on_email(content, hooks, conf):
try:
for hook in hooks:
print('on_email, calling hook {}'.format(hook.__name__))
- context, content = hook(context, content)
+ context2, content2 = hook(context, content)
+ if context2:
+ context = context2
+ if content2:
+ content = content2
except interface.HookStopIteration:
pass
print('now, raising exception')