Skip to content

Commit

Permalink
removed as string usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Gkrumbach07 committed Feb 28, 2023
1 parent d66b016 commit 331b643
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/pages/BYONImages/BYONImagesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const BYONImagesTable: React.FC<BYONImagesTableProps> = ({ images, forceU
const getFilterCount = (value: string, option): number => {
let total = 0;
images.forEach((image) => {
(image[option] as string).includes(value) ? total++ : null;
(image[option] ?? '').includes(value) ? total++ : null;
});
return total;
};
Expand All @@ -99,7 +99,7 @@ export const BYONImagesTable: React.FC<BYONImagesTableProps> = ({ images, forceU
{
field: 'description',
label: 'Description',
sortable: (a, b) => (a.description as string).localeCompare(b.description ?? ''),
sortable: (a, b) => (a.description ?? '').localeCompare(b.description ?? ''),
},
{
field: 'enable',
Expand Down Expand Up @@ -224,7 +224,7 @@ export const BYONImagesTable: React.FC<BYONImagesTableProps> = ({ images, forceU
image[tableFilter.option] &&
tableFilter.option !== 'uploaded'
) {
const BYONImageValue: string = image[tableFilter.option] as string;
const BYONImageValue: string = image[tableFilter.option] ?? '';
return !BYONImageValue.includes(tableFilter.filter);
}
if (
Expand Down

0 comments on commit 331b643

Please sign in to comment.