data/scaledUnits: Handle size === undefined more gracefully (#63218)

This commit is contained in:
kay delaney 2023-02-23 13:23:33 +00:00 committed by GitHub
parent 71b7c62021
commit c769a6281e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,7 +136,7 @@ const logb = (b: number, x: number) => Math.log10(x) / Math.log10(b);
export function scaledUnits(factor: number, extArray: string[], offset = 0): ValueFormatter {
return (size: number, decimals?: DecimalCount) => {
if (size === null) {
if (size === null || size === undefined) {
return { text: '' };
}