From dde188c3c40c01f01b2b0bc49e004f4d658aa828 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 28 Mar 2023 15:51:55 -0700 Subject: [PATCH] Fix calculate memory when no cache value --- src/widgets/docker/stats-helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/docker/stats-helpers.js b/src/widgets/docker/stats-helpers.js index 1b73327e..13c68963 100644 --- a/src/widgets/docker/stats-helpers.js +++ b/src/widgets/docker/stats-helpers.js @@ -11,5 +11,5 @@ export function calculateCPUPercent(stats) { } export function calculateUsedMemory(stats) { - return stats.memory_stats.usage - stats.memory_stats.stats.cache + return stats.memory_stats.usage - (stats.memory_stats.stats.cache ?? 0) } \ No newline at end of file