Fixes possible crash on assembly fetching for third party assemblies

This commit is contained in:
Lord Hepipud 2025-06-16 13:30:16 +02:00
parent 507575c5a9
commit 91c91df9b7

View file

@ -31,12 +31,15 @@ function Test-IcingaAddTypeExist()
}
foreach ($entry in [System.AppDomain]::CurrentDomain.GetAssemblies()) {
if ($entry.GetTypes() -Match $Type) {
$LoadedTypes.Add($Type, $TRUE);
try {
if ($entry.GetTypes() -Match $Type) {
$LoadedTypes.Add($Type, $TRUE);
Set-IcingaPrivateEnvironmentVariable -Name 'AddTypeFunctions' -Value $LoadedTypes;
Set-IcingaPrivateEnvironmentVariable -Name 'AddTypeFunctions' -Value $LoadedTypes;
return $TRUE;
return $TRUE;
}
} catch {
}
}