Skip to content

Commit b7a0d38

Browse files
authored
Merge pull request #542 from Icinga:fix/null-value_exception_for_no_background_daemons_configured
Fix: Null-value exception on missing background daemons Fixes `You cannot call a method on va null-valued expression` during installation or while enabling JEA, in case no background daemons have been configured.
2 parents 8af403d + 906d616 commit b7a0d38

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/100-General/10-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1313

1414
### Bugfixes
1515

16+
* [#476](https://github.com/Icinga/icinga-powershell-framework/pull/476) Fixes exception `You cannot call a method on va null-valued expression` during installation in case no background daemon is configured
1617
* [#529](https://github.com/Icinga/icinga-powershell-framework/pull/529) Fixes package manifest reader for Icinga for Windows components on Windows 2012 R2 and older
1718
* [#523](https://github.com/Icinga/icinga-powershell-framework/pull/523) Fixes errors on encapsulated PowerShell calls for missing Cmdlets `Write-IcingaConsoleError` and `Optimize-IcingaForWindowsMemory`
1819
* [#524](https://github.com/Icinga/icinga-powershell-framework/issues/524) Fixes uninstallation process by improving the location handling of PowerShell instances with Icinga IMC or Shell

lib/daemon/Get-IcingaBackgroundDaemons.psm1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
function Get-IcingaBackgroundDaemons()
22
{
3-
$Daemons = Get-IcingaPowerShellConfig -Path 'BackgroundDaemon.EnabledDaemons';
3+
$Daemons = Get-IcingaPowerShellConfig -Path 'BackgroundDaemon.EnabledDaemons';
4+
[hashtable]$Output = @{ };
45

56
if ($null -eq $Daemons) {
6-
return $null;
7+
return $Output;
78
}
89

9-
[hashtable]$Output = @{ };
10-
1110
foreach ($daemon in $Daemons.PSObject.Properties) {
1211
$Arguments = @{ };
1312

0 commit comments

Comments
 (0)