From 2f4c867f6df1a9c475bb04c7012bbaeccb7e9e46 Mon Sep 17 00:00:00 2001 From: Martin Stone Date: Wed, 5 Jun 2024 11:08:23 -0400 Subject: [PATCH] fix #441 --- src/config/column-generator.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/config/column-generator.jsx b/src/config/column-generator.jsx index 00d4167b..41bda4a0 100644 --- a/src/config/column-generator.jsx +++ b/src/config/column-generator.jsx @@ -644,7 +644,17 @@ export const defaultAlertsColumns = () => [ id: 'severity', header: 'Severity', columnType: 'alert', - accessor: (incident) => incident.alerts?.[0]?.body?.cef_details?.severity || '', + accessor: (incident) => { + if ( + incident.alerts + && incident.alerts instanceof Array + && incident.alerts.length > 0 + && incident.alerts[0] instanceof Object + ) { + return incident.alerts[0].severity || '--'; + } + return '--'; + }, minWidth: 100, renderer: ({ value, cell,