From 0d3d4ded3be8fe3a03c8a9591b000bfe92e5b40b Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Fri, 13 Dec 2024 13:48:30 +0100 Subject: [PATCH] fix inability to handle an optional value in timestamp override --- .../final_edit/fields/timestamp_override.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx index a57d538fab47c..b8ef00ece3b3c 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx @@ -72,10 +72,11 @@ function TimestampFallbackDisabled() { return null; } -export function timestampOverrideDeserializer(defaultValue: FormData) { +export function timestampOverrideDeserializer(_: unknown, finalDiffableRule: DiffableRule) { return { - timestampOverride: defaultValue.timestamp_override.field_name, - timestampOverrideFallbackDisabled: defaultValue.timestamp_override.fallback_disabled ?? false, + timestampOverride: finalDiffableRule.timestamp_override?.field_name, + timestampOverrideFallbackDisabled: + finalDiffableRule.timestamp_override?.fallback_disabled ?? false, }; }