Add safety check for destructuing payload in StatusService

This commit is contained in:
Alex Holliday
2024-11-24 17:39:05 +08:00
parent 80763356e5
commit 257cc73ab3
+1 -1
View File
@@ -104,7 +104,7 @@ class StatusService {
if (type === "hardware") {
const { cpu, memory, disk, host } = payload?.data ?? {};
const { errors } = payload;
const { errors } = payload?.errors ?? [];
check.cpu = cpu ?? {};
check.memory = memory ?? {};
check.disk = disk ?? {};