Skip to content

Commit

Permalink
added check for empty action
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <[email protected]>
  • Loading branch information
amsiglan committed Sep 7, 2023
1 parent 466ddb9 commit 5e39a2f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export const AlertTriggerView: React.FC<AlertTriggerViewProps> = ({
const { name, sev_levels, types, tags, ids, severity, actions } = alertTrigger;
const alertSeverity = parseAlertSeverityToOption(severity)?.label || DEFAULT_EMPTY_DATA;
const action = actions[0];
const notificationChannelId = detector.triggers[orderPosition].actions[0].destination_id;
const notificationChannelId = detector.triggers[orderPosition]?.actions[0]?.destination_id;
const notificationChannel = notificationChannels.find(
(channel) => channel.config_id === notificationChannelId
(channel) => !!notificationChannelId && channel.config_id === notificationChannelId
);
const conditionRuleNames = ids.map((ruleId) => rules[ruleId]?._source.title);
return (
Expand Down

0 comments on commit 5e39a2f

Please sign in to comment.