Skip to content

Commit

Permalink
Refactor volume size calculation to handle null or undefined values e…
Browse files Browse the repository at this point in the history
…xplicitly
  • Loading branch information
GiselleNessi committed Mar 8, 2024
1 parent 7b349ba commit 119002e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const VolumesList = ({ dnp }: { dnp: InstalledPackageDetailData }) => {
}

const totalVolumeSize = volumes.reduce(
(total, vol) => total + (vol.size || 0),
(total, vol) => (vol.size != null ? total + vol.size : total),
0
);

Expand Down

0 comments on commit 119002e

Please sign in to comment.