diff --git a/libs/environment/src/hooks/use-node-health.ts b/libs/environment/src/hooks/use-node-health.ts index 8cb092d86..ba2f8549b 100644 --- a/libs/environment/src/hooks/use-node-health.ts +++ b/libs/environment/src/hooks/use-node-health.ts @@ -22,7 +22,7 @@ export const useNodeHealth = () => { }); const blockDiff = useMemo(() => { - if (!data?.statistics.blockHeight) { + if (!data?.statistics?.blockHeight) { return null; } @@ -31,7 +31,7 @@ export const useNodeHealth = () => { } return Number(data.statistics.blockHeight) - headers.blockHeight; - }, [data?.statistics.blockHeight, headers?.blockHeight]); + }, [data?.statistics?.blockHeight, headers?.blockHeight]); useEffect(() => { if (error) {