Skip to content

Commit

Permalink
fix: #176 protect code when getHeapStatistics returns no metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
wallet77 committed Aug 16, 2018
1 parent 15b4aff commit f3858db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/metricConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class MetricConfig {
}

static setProbesValue (allPossibleMetrics, metrics, probes, defaultUnit) {
if (!metrics) return
if (!metrics || !probes) return
for (let metricName in metrics) {
if (metrics.hasOwnProperty(metricName) && probes.hasOwnProperty(metricName)) {
const value = (allPossibleMetrics[metricName].unit === defaultUnit) ? Math.round(metrics[metricName] / 1000) : metrics[metricName]
Expand Down

0 comments on commit f3858db

Please sign in to comment.