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
- 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.
Describe the bug
In
src/helpers/recordingValidation.js:evaluateFinishedRecording({ blobSize, receivedAudioData } = {})defaults its parameter using= {}, which only triggers when the argument isundefined. When called withnullor a non-object primitive, it throws:TypeError: Cannot destructure property 'blobSize' of 'null' as it is null.To Reproduce
evaluateFinishedRecording(null)-> throwsTypeError.Expected Behavior
evaluateFinishedRecordingshould safely handlenulland non-object inputs, returning{ usable: false, reason: "no-audio-data" }without throwing an error.