fix: handle null speech URLs with fallback to empty string#2158
Open
sebuzdugan wants to merge 1 commit intoAzure-Samples:mainfrom
Open
fix: handle null speech URLs with fallback to empty string#2158sebuzdugan wants to merge 1 commit intoAzure-Samples:mainfrom
sebuzdugan wants to merge 1 commit intoAzure-Samples:mainfrom
Conversation
pamelafox
reviewed
Nov 18, 2024
| } | ||
| if (speechConfig.speechUrls[index]) { | ||
| playAudio(speechConfig.speechUrls[index]); | ||
| playAudio(speechConfig.speechUrls[index] ?? ""); |
Collaborator
There was a problem hiding this comment.
playAudio doesn't seem to have a special check for empty string, besides the catch expression. Does this end up being handled by that catch? Did you find it was better to do this than to add a guard for length and only call playAudio for non-empty strings?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This change resolves a TypeScript error where null speech URLs caused a type mismatch by using a fallback to an empty string. It ensures smooth operation when speech URLs are missing.
Does this introduce a breaking change?
When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.
Does this require changes to learn.microsoft.com docs?
This repository is referenced by this tutorial
which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial,
check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.
Type of change
Code quality checklist
See CONTRIBUTING.md for more details.
python -m pytest).python -m pytest --covto verify 100% coverage of added linespython -m mypyto check for type errorsruffandblackmanually on my code.