From 82f054087aa47d99bc805411d5c0b93b3b340348 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sat, 23 Nov 2019 11:28:39 -0600 Subject: [PATCH] gracefully handle software with no defined syntaxes --- .../src/components/listsTable/ListsTable.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/FilterLists.Web/src/components/listsTable/ListsTable.tsx b/src/FilterLists.Web/src/components/listsTable/ListsTable.tsx index fbfc851c4..64a7bccc8 100644 --- a/src/FilterLists.Web/src/components/listsTable/ListsTable.tsx +++ b/src/FilterLists.Web/src/components/listsTable/ListsTable.tsx @@ -138,7 +138,10 @@ export const ListsTable = (props: RouteComponentProps & Props) => { sorter={(a, b) => { const getSoftwareIds = (l: List) => software - .filter((s: Software) => s.syntaxIds.includes(l.syntaxId)) + .filter( + (s: Software) => + s.syntaxIds && s.syntaxIds.includes(l.syntaxId) + ) .map(s => s.id); return arraySorter(getSoftwareIds(a), getSoftwareIds(b), software); }} @@ -169,8 +172,8 @@ export const ListsTable = (props: RouteComponentProps & Props) => { render={(syntaxId: number) => syntaxId ? ( - s.syntaxIds.includes(syntaxId) + software={software.filter( + (s: Software) => s.syntaxIds && s.syntaxIds.includes(syntaxId) )} /> ) : null