From 28784845fb841e3e9f59c37800b1377703f12f3f Mon Sep 17 00:00:00 2001 From: soulgalore Date: Tue, 8 Aug 2023 09:53:16 +0200 Subject: [PATCH] fix --- lib/support/metricsFilter.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/support/metricsFilter.js b/lib/support/metricsFilter.js index 7d64712f66..80af7463cd 100644 --- a/lib/support/metricsFilter.js +++ b/lib/support/metricsFilter.js @@ -47,10 +47,20 @@ export function filterMetrics(json, metricPaths) { result ); } else { - let branch = get(json, branchPath); let branchPath = path.slice(0, Math.max(0, firstWildcard)); if (branchPath.endsWith('.')) branchPath = branchPath.slice(0, -1); + let branch = get(json, branchPath); + if (!branch) { + // error( + // 'Metricsfilter: The ' + + // branchPath + + // ' is missing from the metrics ' + + // metricPaths + //); + return result; + } + const leafPath = path.slice(Math.max(0, firstWildcard + 2)); const leafs = Object.keys(branch).reduce((result, key) => { const leaf = filterMetrics(branch[key], leafPath);