From 88bd83b07e64d949020829976a091929ce7cc8c4 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Fri, 6 Mar 2026 10:19:46 +0100 Subject: [PATCH] add nullsafe fallbacks --- web/frontend/src/generic/plots/MetricPlot.svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/frontend/src/generic/plots/MetricPlot.svelte b/web/frontend/src/generic/plots/MetricPlot.svelte index aa38d858..3969161d 100644 --- a/web/frontend/src/generic/plots/MetricPlot.svelte +++ b/web/frontend/src/generic/plots/MetricPlot.svelte @@ -300,11 +300,11 @@ let divisor; if (scope == 'node') divisor = 1 // Node Scope: Always return unscaled (Maximum Scope) // Partial Scopes: Get from Topologies - else if (scope == 'socket') divisor = subClusterTopology.socket.length; - else if (scope == "memoryDomain") divisor = subClusterTopology.memoryDomain.length; - else if (scope == "core") divisor = subClusterTopology.core.length; - else if (scope == "hwthread") divisor = subClusterTopology.node.length; - else if (scope == "accelerator") divisor = subClusterTopology.accelerators.length; + else if (scope == 'socket') divisor = subClusterTopology?.socket?.length || 1; + else if (scope == "memoryDomain") divisor = subClusterTopology?.memoryDomain?.length || 1; + else if (scope == "core") divisor = subClusterTopology?.core?.length || 1; + else if (scope == "hwthread") divisor = subClusterTopology?.node?.length || 1; + else if (scope == "accelerator") divisor = subClusterTopology?.accelerators?.length || 1; else { console.log('Unknown scope, return default aggregation thresholds for sum', scope) divisor = 1;