diff --git a/platypush/message/event/__init__.py b/platypush/message/event/__init__.py index a1547989f..29d7606c3 100644 --- a/platypush/message/event/__init__.py +++ b/platypush/message/event/__init__.py @@ -135,8 +135,9 @@ class Event(Message): result.parsed_args[argname] += ' ' + event_token - if len(event_tokens) > 1 and len(condition_tokens) > 1 \ - and event_tokens[1] == condition_tokens[1]: + if len(condition_tokens) == 1 \ + or (len(event_tokens) > 1 and len(condition_tokens) > 1 \ + and event_tokens[1] == condition_tokens[1]): # Stop appending tokens to this argument, as the next # condition will be satisfied as well condition_tokens.pop(0) diff --git a/platypush/message/event/assistant/__init__.py b/platypush/message/event/assistant/__init__.py index 59d5367c0..44cf61148 100644 --- a/platypush/message/event/assistant/__init__.py +++ b/platypush/message/event/assistant/__init__.py @@ -1,3 +1,4 @@ +import logging import re from platypush.context import get_backend @@ -8,7 +9,11 @@ class AssistantEvent(Event): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self._assistant = get_backend('assistant.google') + try: + self._assistant = get_backend('assistant.google') + except KeyError as e: + logging.warning('google.assistant backend not configured/initialized') + self._assistant = None class ConversationStartEvent(AssistantEvent):