diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx index 5cd89006e2813..c38bfb2cc86f0 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx @@ -269,15 +269,9 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({ } ); esTookTime.current = adapters.requests.getRequests().reduce((maxTime, { response }) => { - if (response === undefined) { - return maxTime; - } const took = - ( - response.json as { - rawResponse: estypes.SearchResponse | undefined; - } - )?.rawResponse?.took ?? 0; + (response?.json as { rawResponse: estypes.SearchResponse | undefined } | undefined) + ?.rawResponse?.took ?? 0; return Math.max(maxTime, took); }, 0);