From d3484f3e5717a74b8baba20516c4b7e59bd3f3f3 Mon Sep 17 00:00:00 2001 From: Sander Philipse <94373878+sphilipse@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:12:16 +0100 Subject: [PATCH] [Search] Fix playground crash when adding connector (#198365) Fixes an issue where Playground occasionally crashed because a connector model is undefined. (cherry picked from commit ac3193582edba82a9791e483b143de33ed50f47b) --- .../components/summarization_panel/summarization_model.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/search_playground/public/components/summarization_panel/summarization_model.tsx b/x-pack/plugins/search_playground/public/components/summarization_panel/summarization_model.tsx index e13823d87fd8d..54c8713b35336 100644 --- a/x-pack/plugins/search_playground/public/components/summarization_panel/summarization_model.tsx +++ b/x-pack/plugins/search_playground/public/components/summarization_panel/summarization_model.tsx @@ -93,7 +93,9 @@ export const SummarizationModel: React.FC = ({ useEffect(() => { usageTracker?.click( - `${AnalyticsEvents.modelSelected}_${selectedModel!.value || selectedModel!.connectorType}` + `${AnalyticsEvents.modelSelected}_${ + selectedModel?.value || selectedModel?.connectorType || 'unknown' + }` ); }, [usageTracker, selectedModel]);