From 482c20a3aa6173119aaa33dfacbeb911ef7dfb64 Mon Sep 17 00:00:00 2001 From: gillespi314 <73313222+gillespi314@users.noreply.github.com> Date: Mon, 7 Mar 2022 10:25:12 -0600 Subject: [PATCH] Fix undefined host software error (#4495) --- frontend/pages/hosts/HostDetailsPage/HostDetailsPage.tsx | 4 ++-- .../pages/hosts/HostDetailsPage/SoftwareTab/SoftwareTab.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/pages/hosts/HostDetailsPage/HostDetailsPage.tsx b/frontend/pages/hosts/HostDetailsPage/HostDetailsPage.tsx index cbccca72e0..bf988194f1 100644 --- a/frontend/pages/hosts/HostDetailsPage/HostDetailsPage.tsx +++ b/frontend/pages/hosts/HostDetailsPage/HostDetailsPage.tsx @@ -298,8 +298,8 @@ const HostDetailsPage = ({ } return; // exit early because refectch is pending so we can avoid unecessary steps below } - setHostSoftware(returnedHost.software); - setUsersState(returnedHost.users); + setHostSoftware(returnedHost.software || []); + setUsersState(returnedHost.users || []); if (returnedHost.pack_stats) { const packStatsByType = returnedHost.pack_stats.reduce( ( diff --git a/frontend/pages/hosts/HostDetailsPage/SoftwareTab/SoftwareTab.tsx b/frontend/pages/hosts/HostDetailsPage/SoftwareTab/SoftwareTab.tsx index ca976ecc6a..2e5b59a78c 100644 --- a/frontend/pages/hosts/HostDetailsPage/SoftwareTab/SoftwareTab.tsx +++ b/frontend/pages/hosts/HostDetailsPage/SoftwareTab/SoftwareTab.tsx @@ -64,7 +64,7 @@ const SoftwareTable = ({
Software
- {software.length ? ( + {software?.length ? ( <> {software &&