From 4e9351f9d125e10848084bf0288baf44b4f7718a Mon Sep 17 00:00:00 2001 From: Jordan <51442161+JordanSh@users.noreply.github.com> Date: Thu, 3 Aug 2023 15:48:45 +0300 Subject: [PATCH] [Cloud Security][BUG] preventing potential crash when missing multi account field (#163051) --- .../fleet/public/hooks/use_create_cloud_formation_url.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/fleet/public/hooks/use_create_cloud_formation_url.ts b/x-pack/plugins/fleet/public/hooks/use_create_cloud_formation_url.ts index 861217a272a3..a28b0f46adb4 100644 --- a/x-pack/plugins/fleet/public/hooks/use_create_cloud_formation_url.ts +++ b/x-pack/plugins/fleet/public/hooks/use_create_cloud_formation_url.ts @@ -17,7 +17,7 @@ type AwsAccountType = 'single_account' | 'organization_account'; const CLOUDBEAT_AWS = 'cloudbeat/cis_aws'; const getAwsAccountType = (input?: PackagePolicyInput): AwsAccountType | undefined => - input?.streams[0].vars?.['aws.account_type'].value; + input?.streams[0].vars?.['aws.account_type']?.value; export const useCreateCloudFormationUrl = ({ enrollmentAPIKey,