diff --git a/src/renderer/utils/format-size-string.ts b/src/renderer/utils/format-size-string.ts index 00bb7f5e..e24f300e 100644 --- a/src/renderer/utils/format-size-string.ts +++ b/src/renderer/utils/format-size-string.ts @@ -1,8 +1,8 @@ const SIZES = ['B', 'KiB', 'MiB', 'GiB', 'TiB']; -export const formatSizeString = (size: number): string => { +export const formatSizeString = (size?: number): string => { let count = 0; - let finalSize = size; + let finalSize = size ?? 0; while (finalSize > 1024) { finalSize /= 1024; count += 1;