Skip to content

Commit

Permalink
Fixed a bug where the frontend would error due to calling .toLowerCas…
Browse files Browse the repository at this point in the history
…e() on a null or undefined value which could happen sometimes if the api filter options are in an incorrect state. (#22796)

Co-authored-by: Robert Travis Pierce <robert@roberttravispierce.com>
  • Loading branch information
TylerBroyles and roberttravispierce authored Sep 12, 2024
1 parent 443c9e9 commit 2cd6e15
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/app/components/TableFilter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ class TableFilter extends React.PureComponent {
});

// Case insensitive ordering for the filter options
return _.orderBy(filterOptionsFromApi, [(option) => option.displayText.toLowerCase()], ['asc']);
return _.orderBy(
filterOptionsFromApi.filter((option) => option.displayText),
[(option) => option.displayText.toLowerCase()],
['asc']
);
}

const columnValues = tableDataByRow.map((obj) => {
Expand Down

0 comments on commit 2cd6e15

Please sign in to comment.