From aeabef76ef1dd4f796376e64d9965e369a3508ec Mon Sep 17 00:00:00 2001 From: "Gabriel SAILLARD (GitSquared)" Date: Tue, 30 Apr 2019 11:18:43 +0200 Subject: [PATCH] :ambulance: Fix some DOM errors on ramwatcher's swap bar ...that occured when the swap usage was below 0 --- src/classes/ramwatcher.class.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/ramwatcher.class.js b/src/classes/ramwatcher.class.js index 5c33f17e..a55f2fff 100644 --- a/src/classes/ramwatcher.class.js +++ b/src/classes/ramwatcher.class.js @@ -66,7 +66,7 @@ class RAMwatcher { // Update swap indicator let usedSwap = Math.round((100*data.swapused)/data.swaptotal); - document.getElementById("mod_ramwatcher_swapbar").value = usedSwap; + document.getElementById("mod_ramwatcher_swapbar").value = usedSwap || 0; let usedSwapGiB = Math.round((data.swapused/1073742000)*10)/10; document.getElementById("mod_ramwatcher_swaptext").innerText = `${usedSwapGiB} GiB`;