Check if cluster entry exists before showing memory usage in stats

This commit is contained in:
Essem 2021-09-15 23:42:29 -05:00
parent 3b4b302634
commit f62775df61
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -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
},
{