Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/extensions/core/uploadAudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ app.registerExtension({
audioUIWidget.options.canvasOnly = true

const onAudioWidgetUpdate = () => {
if (typeof audioWidget.value !== 'string') return
audioUIWidget.element.src = api.apiURL(
getResourceURL(...splitFilePath(audioWidget.value as string))
getResourceURL(...splitFilePath(audioWidget.value))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How resilient is the splitFilePath function? Can i handle empty strings

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't throw an error, but it'll still result in a request being made for an empty filename.

Directly un-setting audioUIWidget.element.src could be beneficial, but I'm reasonably confident this invalid typing can only occur on workflow load where such a change doesn't make a difference.

)
}
// Initially load default audio file to audioUIWidget.
Expand Down