From 6606e73226f56061b8094f58c8fb63597e831a0c Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Fri, 20 Nov 2020 12:03:42 +0100 Subject: [PATCH] Fix invalid check if web response has errors --- lib/core/framework/Get-IcingaPowerShellModuleArchive.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/framework/Get-IcingaPowerShellModuleArchive.psm1 b/lib/core/framework/Get-IcingaPowerShellModuleArchive.psm1 index f331dd9..1f43ebd 100644 --- a/lib/core/framework/Get-IcingaPowerShellModuleArchive.psm1 +++ b/lib/core/framework/Get-IcingaPowerShellModuleArchive.psm1 @@ -72,7 +72,7 @@ function Get-IcingaPowerShellModuleArchive() } else { $WebResponse = Invoke-IcingaWebRequest -Uri 'https://github.com/{0}/{1}/releases/latest' -Objects $GitHubUser, $Repository -UseBasicParsing; - if ($WebResponse.HasErrors -eq $FALSE) { + if ($null -eq $WebResponse.HasErrors -Or $WebResponse.HasErrors -eq $FALSE) { $LatestRelease = $WebResponse.BaseResponse.ResponseUri.AbsoluteUri; $DownloadUrl = $LatestRelease.Replace('/releases/tag/', '/archive/'); $Tag = $DownloadUrl.Split('/')[-1];