From 23c6a6fc5accf00c881c44a3c36a5cc297af639a Mon Sep 17 00:00:00 2001 From: Anton Butsyk Date: Wed, 8 Jul 2020 11:41:24 +0300 Subject: [PATCH] Added: actions is None check --- business_rules/engine.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/business_rules/engine.py b/business_rules/engine.py index ed777050..7483f9ad 100644 --- a/business_rules/engine.py +++ b/business_rules/engine.py @@ -32,6 +32,9 @@ async def run( """ conditions, actions = rule['conditions'], rule['actions'] + if actions is None: + raise InvalidRuleDefinition('Actions are None') + if len(actions) !=1: raise InvalidRuleDefinition(f'You should specify only one action, ' f'but specified: {len(actions)}')