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);