Fix undefined host software error (#4495)

This commit is contained in:
gillespi314
2022-03-07 10:25:12 -06:00
committed by GitHub
parent 1884726f55
commit 482c20a3aa
2 changed files with 3 additions and 3 deletions
@@ -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(
(
@@ -64,7 +64,7 @@ const SoftwareTable = ({
<div className="section section--software">
<p className="section__header">Software</p>
{software.length ? (
{software?.length ? (
<>
{software && <SoftwareVulnCount softwareList={software} />}
{software && (