Skip to content

evaluateFinishedRecording throws TypeError when called with null #1839

Description

@hsusul

Describe the bug

In src/helpers/recordingValidation.js:

evaluateFinishedRecording({ blobSize, receivedAudioData } = {}) defaults its parameter using = {}, which only triggers when the argument is undefined. When called with null or a non-object primitive, it throws:

TypeError: Cannot destructure property 'blobSize' of 'null' as it is null.

To Reproduce

  1. Call evaluateFinishedRecording(null) -> throws TypeError.

Expected Behavior

evaluateFinishedRecording should safely handle null and non-object inputs, returning { usable: false, reason: "no-audio-data" } without throwing an error.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions