Skip to content

Commit

Permalink
ensure recognizer.altLanguages is an empty array if not otherwise spe…
Browse files Browse the repository at this point in the history
…cified
  • Loading branch information
davehorton committed Oct 12, 2023
1 parent 4ffa9f9 commit a92ea9c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/tasks/stt-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class SttTask extends Task {

/* let credentials be supplied in the recognizer object at runtime */
this.sttCredentials = setSpeechCredentialsAtRuntime(recognizer);

if (!Array.isArray(this.data.recognizer.altLanguages)) {
this.data.recognizer.altLanguages = [];
}
} else {
this.data.recognizer = {hints: [], altLanguages: []};
}
Expand Down

0 comments on commit a92ea9c

Please sign in to comment.