From ee8ceda65d288539eecd2c0d26d44249e21fbfbd Mon Sep 17 00:00:00 2001 From: Sergi Romeu Date: Fri, 4 Oct 2024 17:29:28 +0200 Subject: [PATCH] refactor: remove useless optional chaining --- .../get_error_groups/get_error_group_main_statistics.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/observability_solution/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts b/x-pack/plugins/observability_solution/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts index f914a125f2e2d..b493dd8cbc562 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts @@ -166,10 +166,10 @@ export async function getErrorGroupMainStatistics({ name: getErrorName({ error: normalizedFields?.error } as APMError), lastSeen: new Date(normalizedFields?.['@timestamp'] as string).getTime(), occurrences: bucket.doc_count, - culprit: normalizedFields?.error?.culprit, - handled: normalizedFields?.error?.exception[0]?.handled, - type: normalizedFields?.error?.exception[0]?.type, - traceId: normalizedFields?.trace?.id, + culprit: normalizedFields?.error.culprit, + handled: normalizedFields?.error.exception[0].handled, + type: normalizedFields?.error.exception[0].type, + traceId: normalizedFields?.trace.id, }; }) ?? [];