diff --git a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 index b01c6f1..8d8428e 100644 --- a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 +++ b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 @@ -289,11 +289,9 @@ function New-IcingaCheckPackage() if ([int]$this.exitcode -eq [int]$IcingaEnums.IcingaExitCode.Unknown) { return; } - $worstCheck = $null; foreach ($check in $this.checks) { if ([int]$this.exitcode -lt $check.exitcode) { $this.exitcode = $check.exitcode; - $worstCheck = $check; } } }