From 2f9b425b11128d9401d94de8771264429cc1e8e5 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 9 Jun 2023 16:58:17 +0200 Subject: [PATCH] fix(ui): performance tab crashing when payload is empty --- frontend/app/components/Session_/Performance/Performance.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/app/components/Session_/Performance/Performance.tsx b/frontend/app/components/Session_/Performance/Performance.tsx index 727683060..e06ce373e 100644 --- a/frontend/app/components/Session_/Performance/Performance.tsx +++ b/frontend/app/components/Session_/Performance/Performance.tsx @@ -54,6 +54,7 @@ const CPU = 'CPU Load'; const NODES_COUNT = 'Nodes Сount'; const FPSTooltip = ({ active, payload }) => { + if (!payload) return null; if (!active || !payload || payload.length < 3) { return null; } @@ -82,6 +83,7 @@ const FPSTooltip = ({ active, payload }) => { }; const CPUTooltip = ({ active, payload }) => { + if (!payload) return null; if (!active || payload.length < 1 || payload[0].value === null) { return null; } @@ -95,6 +97,7 @@ const CPUTooltip = ({ active, payload }) => { }; const HeapTooltip = ({ active, payload }) => { + if (!payload) return null; if (!active || payload.length < 2) return null; return (
@@ -111,6 +114,7 @@ const HeapTooltip = ({ active, payload }) => { }; const NodesCountTooltip = ({ active, payload }) => { + if (!payload) return null; if (!active || !payload || payload.length === 0) return null; return (