handle undefined user-slected platform string

This commit is contained in:
Jacob Shandling 2023-07-17 14:28:13 -07:00
parent 31342a4b66
commit c392837434

View file

@ -166,9 +166,11 @@ const generateTableHeaders = ({
accessor: "platforms",
Cell: (cellProps: IPlatformCellProps): JSX.Element => {
// translate the SelectedPlatformString into an array of `SupportedPlatform`s
const selectedPlatforms = cellProps.row.original.platform
.split(",")
.filter((platform) => platform !== "") as SupportedPlatform[];
const selectedPlatforms =
(cellProps.row.original.platform
?.split(",")
.filter((platform) => platform !== "") as SupportedPlatform[]) ??
[];
const platformIconsToRender: SupportedPlatform[] =
selectedPlatforms.length === 0