Skip to content

Commit

Permalink
Fix potential bug in context validation
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Oct 26, 2023
1 parent 70e10ff commit 6a2ae88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion neon_speech/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def __init__(self, ready_hook=on_ready, error_hook=on_error,
self.api_stt = None

def _validate_message_context(self, message: Message, native_sources=None):
if "audio" not in message.context['destination']:
if message.context.get('destination') and \
"audio" not in message.context['destination']:
log_deprecation(f"Adding audio to destination context for "
f"{message.msg_type}", "5.0.0")
message.context['destination'].append('audio')
Expand Down

0 comments on commit 6a2ae88

Please sign in to comment.