fix(package): behave with missing thresholds object

This commit is contained in:
Julien Fontanet 2016-10-18 17:34:06 +02:00
parent 0317d6a862
commit 01686b8e60

View File

@ -99,10 +99,10 @@ export default class Plan {
this._excludedHosts = excludedHosts this._excludedHosts = excludedHosts
this._thresholds = { this._thresholds = {
cpu: { cpu: {
critical: numberOrDefault(thresholds.cpu, DEFAULT_CRITICAL_THRESHOLD_CPU) critical: numberOrDefault(thresholds && thresholds.cpu, DEFAULT_CRITICAL_THRESHOLD_CPU)
}, },
memoryFree: { memoryFree: {
critical: numberOrDefault(thresholds.memoryFree, DEFAULT_CRITICAL_THRESHOLD_MEMORY_FREE) * 1024 critical: numberOrDefault(thresholds && thresholds.memoryFree, DEFAULT_CRITICAL_THRESHOLD_MEMORY_FREE) * 1024
} }
} }