Fix frontend error when loading unconfig'd metric

This commit is contained in:
Christoph Kluge 2023-05-08 17:43:34 +02:00
parent b8e864e6e4
commit 760d3dec0f

View File

@ -85,9 +85,12 @@
.map(function (name) { .map(function (name) {
// Get MetricConf for this selected/requested metric // Get MetricConf for this selected/requested metric
let thisConfig = metricConfig(cluster, name); let thisConfig = metricConfig(cluster, name);
let thisSCIndex = thisConfig.subClusters.findIndex( let thisSCIndex = -1
(sc) => sc.name == job.subCluster if (thisConfig) {
); thisSCIndex = thisConfig.subClusters.findIndex(
(sc) => sc.name == job.subCluster
);
};
// Check if Subcluster has MetricConf: If not found (index == -1), no further remove flag check required // Check if Subcluster has MetricConf: If not found (index == -1), no further remove flag check required
if (thisSCIndex >= 0) { if (thisSCIndex >= 0) {
// SubCluster Config present: Check if remove flag is set // SubCluster Config present: Check if remove flag is set