fix nan check in system graphs (#11312)

This commit is contained in:
Josh Hawkins 2024-05-09 08:55:19 -05:00 committed by GitHub
parent f8523d9ddf
commit 021ffb2437
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -145,7 +145,7 @@ export function ThresholdBarGraph({
} }
const getUnitSize = (MB: number) => { const getUnitSize = (MB: number) => {
if (isNaN(MB) || MB < 0) return "Invalid number"; if (MB === null || isNaN(MB) || MB < 0) return "Invalid number";
if (MB < 1024) return `${MB.toFixed(2)} MiB`; if (MB < 1024) return `${MB.toFixed(2)} MiB`;
if (MB < 1048576) return `${(MB / 1024).toFixed(2)} GiB`; if (MB < 1048576) return `${(MB / 1024).toFixed(2)} GiB`;