Fixes invalid threshold comparison in case either warning or critical threshold is empty

This commit is contained in:
Lord Hepipud 2026-01-26 15:37:23 +01:00
parent b886269bbf
commit 4a40a001e8

View file

@ -1075,6 +1075,11 @@ function New-IcingaCheck()
return;
}
# Just in case one of the thresholds is not set, we cannot validate anything
if ([string]::IsNullOrEmpty($this.__WarningValue.Threshold.Threshold) -or [string]::IsNullOrEmpty($this.__CriticalValue.Threshold.Threshold)) {
return;
}
[bool]$OutOfRange = $FALSE;
# Both thresholds use the mode