Skip to content

Commit 7f2ddc7

Browse files
committed
chore: add property checks to content type check
1 parent 3f97b80 commit 7f2ddc7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

speech-to-text/v1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ class SpeechToTextV1 extends GeneratedSpeechToTextV1 {
484484
}
485485

486486
recognize(params, callback) {
487-
if (isStream(params.audio) && !params.content_type) {
487+
if (params && params.audio && isStream(params.audio) && !params.content_type) {
488488
callback(new Error('If providing `audio` as a Stream, `content_type` is required.'));
489489
return;
490490
}

0 commit comments

Comments
 (0)