If lastItem['content'] is empty the lastChar calculation will fail.
Issue #, if available:
Description of changes:
If selectedAlternative is empty due a confidence of 0.0, it set the transcript['content'] value as empty.
When that empty value is the last one on transcripts array, the code that calculate the last character some lines bellow, will fail with and string index out of range error.
Use selectedAlternative as workarround.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
If
lastItem['content']
is empty the lastChar calculation will fail.Issue #, if available:
Description of changes:
If selectedAlternative is empty due a confidence of 0.0, it set the
transcript['content']
value as empty.When that empty value is the last one on transcripts array, the code that calculate the last character some lines bellow, will fail with and
string index out of range
error.Use selectedAlternative as workarround.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.