Skip to content

Commit 6e314a2

Browse files
Fix crash when backend has no rrSCParity property (#2826)
1 parent dc90db6 commit 6e314a2

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,33 +285,21 @@ const BasicDashboard = ({ usage }: IDashboardProps) => {
285285
<TimeStatItem
286286
icon={<StorageIcon />}
287287
label={"Backend type"}
288-
value={
289-
usage?.backend?.backendType
290-
? usage.backend.backendType
291-
: "Unknown"
292-
}
288+
value={usage?.backend?.backendType ?? "Unknown"}
293289
/>
294290
</Grid>
295291
<Grid item xs={4}>
296292
<TimeStatItem
297293
icon={<FormatDrivesIcon />}
298294
label={"Standard storage class parity"}
299-
value={
300-
usage?.backend?.standardSCParity
301-
? usage.backend.standardSCParity.toString()
302-
: "n/a"
303-
}
295+
value={usage?.backend?.standardSCParity?.toString() ?? "n/a"}
304296
/>
305297
</Grid>
306298
<Grid item xs={4}>
307299
<TimeStatItem
308300
icon={<FormatDrivesIcon />}
309301
label={"Reduced redundancy storage class parity"}
310-
value={
311-
usage?.backend?.standardSCParity
312-
? usage.backend.rrSCParity.toString()
313-
: "n/a"
314-
}
302+
value={usage?.backend?.rrSCParity?.toString() ?? "n/a"}
315303
/>
316304
</Grid>
317305
</Grid>

0 commit comments

Comments
 (0)