add nullsafes to frontend

This commit is contained in:
Christoph Kluge
2026-03-13 14:20:45 +01:00
parent cbe46c3524
commit bc214f6cea
10 changed files with 36 additions and 36 deletions

View File

@@ -175,13 +175,13 @@
{:else if item?.data}
<!-- "Empty Series"-Warning included in MetricPlot-Component -->
<!-- #key: X-axis keeps last selected timerange otherwise -->
{#key item.data[0].metric.series[0].data.length}
{#key item?.data[0]?.metric?.series[0]?.data?.length}
<MetricPlot
timestep={item.data[0].metric.timestep}
series={item.data[0].metric.series}
metric={item.data[0].name}
timestep={item?.data[0]?.metric?.timestep || 60}
series={item?.data[0]?.metric?.series || []}
metric={item?.data[0]?.name || 'unknown'}
{cluster}
subCluster={item.subCluster}
subCluster={item?.subCluster || 'unknown'}
forNode
enableFlip
/>

View File

@@ -109,7 +109,7 @@
<Button class="flex-grow-1" color="warning" disabled>
Missing Metric
</Button>
{:else if nodeJobsData.jobs.count == 1 && nodeJobsData.jobs.items[0].shared == "none"}
{:else if nodeJobsData.jobs.count == 1 && nodeJobsData?.jobs?.items[0]?.shared == "none"}
<InputGroupText class="flex-grow-1 flex-lg-grow-0">
<Icon name="circle-fill" style="padding-right: 0.5rem;"/>
<span>Jobs</span>
@@ -117,7 +117,7 @@
<Button class="flex-grow-1" color="success" disabled>
Exclusive
</Button>
{:else if nodeJobsData.jobs.count >= 1 && !(nodeJobsData.jobs.items[0].shared == "none")}
{:else if nodeJobsData.jobs.count >= 1 && !(nodeJobsData?.jobs?.items[0]?.shared == "none")}
<InputGroupText class="flex-grow-1 flex-lg-grow-0">
<Icon name="circle-half" style="padding-right: 0.5rem;"/>
<span>Jobs</span>