ChromeVox voice switching: fix crash when checking available voices.
This patch fixes a crash that occurred when checking the available voices. Previously, we were assuming that TtsVoice objects, returned by chrome.tts.getVoices(), had a certain structure e.g. that the voice property was always set. This is not always the case, and the documentation states that all properties are actually optional. We now perform an error check before accessing TtsVoice.lang, which was the root of the issue. The test suite has been updated to check this case as well. Bug: 923068 Change-Id: I5936ab683c46add944bd915b7722733dbdf761bd Relnotes: N/A Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2163153 Commit-Queue: Akihiro Ota <akihiroota@chromium.org> Reviewed-by:David Tseng <dtseng@chromium.org> Cr-Commit-Position: refs/heads/master@{#762095}
Showing
Please register or sign in to comment