diff --git a/src/modules/server/index.ts b/src/modules/server/index.ts index f037e4b..59a6913 100644 --- a/src/modules/server/index.ts +++ b/src/modules/server/index.ts @@ -38,7 +38,7 @@ export default class ServerModule implements IModule { private check = () => { const average = (arr) => arr.reduce((a, b) => a + b) / arr.length; - const cpuPercentages = this.statsLogs.map(s => s.cpu_usage * 100); + const cpuPercentages = this.statsLogs.map(s => s && s.cpu_usage * 100 || 0); const cpuPercentage = average(cpuPercentages); if (cpuPercentage >= 70) { this.warn();