From bc65a482f2e31f07fa2f317ccde4b7788eed7cc2 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 23 Jan 2025 02:59:18 +1100 Subject: [PATCH] [8.x] [Fleet] Fix UI error when agent goes to orphaned state (#207746) (#207836) # Backport This will backport the following commits from `main` to `8.x`: - [[Fleet] Fix UI error when agent goes to orphaned state (#207746)](https://github.com/elastic/kibana/pull/207746) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com> --- .../plugins/shared/fleet/server/services/agents/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/platform/plugins/shared/fleet/server/services/agents/helpers.ts b/x-pack/platform/plugins/shared/fleet/server/services/agents/helpers.ts index 94a25ba59df59..11b1e229a1c47 100644 --- a/x-pack/platform/plugins/shared/fleet/server/services/agents/helpers.ts +++ b/x-pack/platform/plugins/shared/fleet/server/services/agents/helpers.ts @@ -41,7 +41,7 @@ export function searchHitToAgent( return acc; }, {} as OutputMap) : undefined; - const components: FleetServerAgentComponent[] | undefined = hit._source?.components + const components: FleetServerAgentComponent[] | undefined = Array.isArray(hit._source?.components) ? hit._source?.components.map((component) => ({ id: component.id, type: component.type,