From ad1c468b88a26d6fa15513337efc75315567e512 Mon Sep 17 00:00:00 2001 From: "konrad.szwarc" Date: Tue, 24 Oct 2023 13:43:44 +0200 Subject: [PATCH] wip --- .../security_solution/scripts/endpoint/common/fleet_services.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts b/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts index 50b9349459a82..e26d034b059c0 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts @@ -157,7 +157,7 @@ export const waitForHostToEnroll = async ( kuery: `(local_metadata.host.hostname.keyword : "${hostname}")`, showInactive: false, }).then((response) => { - agentId = response.items[0].id; + agentId = response.items[0]?.id; return response.items.filter((agent) => agent.status === 'online')[0]; }), RETRYABLE_TRANSIENT_ERRORS