fix: TypeError in hardware notifications for null disk values

This commit is contained in:
Fredrik Burmester committed 2025-05-14 16:08:18 +02:00
1 parent 7a1b51a1fd
commit be20fb0dbb
1 file changed
+1 -3
+1 -3
View File
@@ -257,9 +257,7 @@ class NotificationService {
const alerts = {
cpu: cpuThreshold !== -1 && cpuUsage > cpuThreshold ? true : false,
memory: memoryThreshold !== -1 && memoryUsage > memoryThreshold ? true : false,
disk: disk.some((d) => diskThreshold !== -1 && d.usage_percent > diskThreshold)
? true
: false,
disk: disk?.some(d => diskThreshold !== -1 && d.usage_percent > diskThreshold) ?? false,
};
const notifications = await this.db.getNotificationsByMonitorId(