From 34f7014d6977cf73b792a64bcd9bf7c54b72cf42 Mon Sep 17 00:00:00 2001 From: Jen Huang Date: Thu, 19 Nov 2020 14:42:49 -0800 Subject: [PATCH] Fix bug creating new policy on the fly --- .../create_package_policy_page/step_select_agent_policy.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_select_agent_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_select_agent_policy.tsx index 9c94bb939cdf8e..01b18b1fc24017 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_select_agent_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_select_agent_policy.tsx @@ -246,7 +246,7 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{ id="xpack.fleet.createPackagePolicy.StepSelectPolicy.agentPolicyAgentsDescriptionText" defaultMessage="{count, plural, one {# agent} other {# agents}} are enrolled with the selected agent policy." values={{ - count: agentPoliciesById[selectedPolicyId].agents || 0, + count: agentPoliciesById[selectedPolicyId]?.agents || 0, }} /> ) : null