Skip to content

Commit 0ac684d

Browse files
committed
refactor: add null check for processing metrics in stt websocket
1 parent 18d07e7 commit 0ac684d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Scripts/Services/SpeechToText/V1/SpeechToTextServiceExtension.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,10 @@ private void SendStart()
562562
start["speech_detector_sensitivity"] = SpeechDetectorSensitivity;
563563
if (BackgroundAudioSuppression != null)
564564
start["background_audio_suppression"] = BackgroundAudioSuppression;
565-
start["processing_metrics"] = ProcessingMetrics;
566-
start["processing_metrics_interval"] = ProcessingMetricsInterval;
565+
if (ProcessingMetrics != null)
566+
start["processing_metrics"] = ProcessingMetrics;
567+
if (ProcessingMetricsInterval != null)
568+
start["processing_metrics_interval"] = ProcessingMetricsInterval;
567569

568570
_listenSocket.Send(new WSConnector.TextMessage(Json.Serialize(start)));
569571
#if ENABLE_DEBUGGING

0 commit comments

Comments
 (0)