Merge pull request #2273 from fredrikburmester/develop

fix: TypeError in hardware notifications for null disk values
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-05-14 10:43:52 -07:00
commit 3da5be3602
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 && typeof d?.usage_percent === "number" && d?.usage_percent > diskThreshold) ?? false,
};
const notifications = await this.db.getNotificationsByMonitorId(