From 8312bca799b172ffaafa056bd1b6a3716fc168dc Mon Sep 17 00:00:00 2001 From: Howard Gil Date: Tue, 24 Feb 2026 10:29:38 -0800 Subject: [PATCH] fix: guard against undefined return from sendFunction in push-to-talk sendFunction (wrapping sendMessage) returns Promise, so accessing .id on the result throws a TypeError. Add a null check to skip setting startReadingFromMessageId when the return value is undefined. Fixes #3042, fixes #3011 Co-Authored-By: Claude Opus 4.6 --- packages/v1/react-ui/src/hooks/use-push-to-talk.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/v1/react-ui/src/hooks/use-push-to-talk.tsx b/packages/v1/react-ui/src/hooks/use-push-to-talk.tsx index 75ac5449327..96205be7a67 100644 --- a/packages/v1/react-ui/src/hooks/use-push-to-talk.tsx +++ b/packages/v1/react-ui/src/hooks/use-push-to-talk.tsx @@ -155,7 +155,9 @@ export const usePushToTalk = ({ recordedChunks.current = []; setPushToTalkState("idle"); const message = await sendFunction(transcription); - setStartReadingFromMessageId(message.id); + if (message) { + setStartReadingFromMessageId(message.id); + } }); } }