From 113e2573daf64ca2fb84d3ce5f796498af9fd999 Mon Sep 17 00:00:00 2001 From: Cyril Galibern Date: Mon, 25 Aug 2025 11:39:47 +0200 Subject: [PATCH] Fix ObjInstanceStateList error when object is purged This commit fixes null and undefined handling in ObjInstanceStateList component. It Refactors object property access to ensure robust checks for undefined values, improving stability and preventing runtime errors. ## Fixed error: TypeError: Cannot read properties of undefined (reading 'avail') at src/js/components/ObjInstanceStateList.jsx?:29:20 --- src/js/components/ObjInstanceStateList.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/js/components/ObjInstanceStateList.jsx b/src/js/components/ObjInstanceStateList.jsx index 284ecdc..65a9e6d 100644 --- a/src/js/components/ObjInstanceStateList.jsx +++ b/src/js/components/ObjInstanceStateList.jsx @@ -16,8 +16,16 @@ function ObjInstanceStateList(props) { if (cstat.monitor === undefined) { return null } - var data = cstat.monitor.nodes[node].services.status[path] - return ( + let nodeData = cstat.monitor.nodes[node] + if (nodeData === undefined) { + return null + } + let data = nodeData.services.status[path] + if (data === undefined) { + return null + } + + return (