Skip to content

Commit a9013b6

Browse files
authored
HDDS-14422. Handle null values and empty strings for overview summary cards (#9676)
1 parent e9c5912 commit a9013b6

File tree

1 file changed

+3
-2
lines changed
  • hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/overview

1 file changed

+3
-2
lines changed

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/overview/overview.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ const getHealthIcon = (value: string): React.ReactElement => {
7171
}
7272

7373
const getSummaryTableValue = (
74-
value: number | string | undefined,
74+
value: number | string | undefined | null,
7575
colType: 'value' | undefined = undefined
7676
): string => {
77-
if (!value) return 'N/A';
77+
if (value === null || value === undefined) return 'N/A';
78+
if (typeof value === 'string' && value.trim() === '') return 'N/A';
7879
if (colType === 'value') return String(value as string)
7980
return size(value as number)
8081
}

0 commit comments

Comments
 (0)