diff --git a/x-pack/plugins/security_solution/public/timelines/components/graph_overlay/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/graph_overlay/index.tsx index 1a0582cb58844..dc9557da70f91 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/graph_overlay/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/graph_overlay/index.tsx @@ -141,13 +141,12 @@ const GraphOverlayComponent = ({ const { signalIndexName } = useSignalIndex(); const [siemDefaultIndices] = useUiSetting$(DEFAULT_INDEX_KEY); - const indices: string[] = useMemo(() => { - const allIndices = [...siemDefaultIndices]; - - if (signalIndexName !== null) { - allIndices.push(signalIndexName); + const indices: string[] | null = useMemo(() => { + if (signalIndexName === null) { + return null; + } else { + return [...siemDefaultIndices, signalIndexName]; } - return allIndices; }, [signalIndexName, siemDefaultIndices]); return ( @@ -191,7 +190,7 @@ const GraphOverlayComponent = ({ - {graphEventId !== undefined && ( + {graphEventId !== undefined && indices !== null && (