From 30c21dc7f2f164e4b52940d4b394bfd0ac82df5e Mon Sep 17 00:00:00 2001 From: VG Date: Wed, 8 Jun 2016 23:35:11 +0200 Subject: add protection if hook returns none --- climl/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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') -- cgit v1.2.3