Make sure structure for wake word exist before use

==== Fixed Issues ====
#1105

====  Tech Notes ====
Verify that the sub-config for the set wake word exist before writing to
it.
pull/1099/merge
Åke Forslund 2017-09-22 09:10:19 +02:00 committed by Steve Penrod
parent f5806b86c5
commit 605f0640ec
1 changed files with 2 additions and 0 deletions

View File

@ -221,6 +221,8 @@ class RecognizerLoop(EventEmitter):
phonemes = self.config.get("phonemes")
thresh = self.config.get("threshold")
config = self.config_core.get("hotwords", {word: {}})
if word not in config:
config[word] = {}
if phonemes:
config[word]["phonemes"] = phonemes
if thresh: