File tree Expand file tree Collapse file tree
x-pack/legacy/plugins/siem/server/lib/detection_engine Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,7 +68,10 @@ export const createFindRulesStatusRoute: Hapi.ServerRoute = {
6868 return {
6969 ...( await acc ) ,
7070 [ id ] : {
71- current_status : convertToSnakeCase ( lastFiveErrorsForId . saved_objects [ 0 ] . attributes ) ,
71+ current_status :
72+ lastFiveErrorsForId . saved_objects . length > 0
73+ ? convertToSnakeCase ( lastFiveErrorsForId . saved_objects [ 0 ] . attributes )
74+ : null ,
7275 failures : lastFiveErrorsForId . saved_objects
7376 . slice ( 1 )
7477 . map ( errorItem => convertToSnakeCase ( errorItem . attributes ) ) ,
Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ export interface IRuleStatusAttributes {
5858
5959export interface RuleStatusResponse {
6060 [ key : string ] : {
61- current_status : IRuleStatusAttributes ;
62- failures : IRuleStatusAttributes [ ] ;
61+ current_status : IRuleStatusAttributes | null | undefined ;
62+ failures : IRuleStatusAttributes [ ] | null | undefined ;
6363 } ;
6464}
6565
You can’t perform that action at this time.
0 commit comments