Add safety check for destructuing payload in StatusService
This commit is contained in:
1 parent
80763356e5
commit
257cc73ab3
1 file changed
+1
-1
@@ -104,7 +104,7 @@ class StatusService {
|
|||||||
|
|
||||||
if (type === "hardware") {
|
if (type === "hardware") {
|
||||||
const { cpu, memory, disk, host } = payload?.data ?? {};
|
const { cpu, memory, disk, host } = payload?.data ?? {};
|
||||||
const { errors } = payload;
|
const { errors } = payload?.errors ?? [];
|
||||||
check.cpu = cpu ?? {};
|
check.cpu = cpu ?? {};
|
||||||
check.memory = memory ?? {};
|
check.memory = memory ?? {};
|
||||||
check.disk = disk ?? {};
|
check.disk = disk ?? {};
|
||||||
|
|||||||
Reference in new issue
Block a user