From f62775df61459224cfbe76bf5544157484a93ea2 Mon Sep 17 00:00:00 2001 From: Essem Date: Wed, 15 Sep 2021 23:42:29 -0500 Subject: [PATCH] Check if cluster entry exists before showing memory usage in stats --- commands/general/stats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/general/stats.js b/commands/general/stats.js index adfe6f1..22dcda1 100644 --- a/commands/general/stats.js +++ b/commands/general/stats.js @@ -24,7 +24,7 @@ class StatsCommand extends Command { }, { "name": "Cluster Memory Usage", - "value": stats ? `${stats.clusters[this.cluster].ram.toFixed(2)} MB` : `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB`, + "value": stats && stats.clusters[this.cluster] ? `${stats.clusters[this.cluster].ram.toFixed(2)} MB` : `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB`, "inline": true }, {