Skip to content

Commit 2da26fb

Browse files
committed
Fix null-coalescing operator usage in alert retrieval
Wraps the pipeline expression in parentheses before applying the null-coalescing operator to ensure correct evaluation when retrieving alerts.
1 parent d059f5e commit 2da26fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/CIPPCore/Public/Entrypoints/Invoke-ListCheckExtAlerts.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function Invoke-ListCheckExtAlerts {
2222

2323
try {
2424
$Tenants = Get-Tenants -IncludeErrors
25-
$Alerts = Get-CIPPAzDataTableEntity @Table -Filter $Filter | Where-Object { $Tenants.defaultDomainName -contains $_.tenantFilter } ?? @()
25+
$Alerts = (Get-CIPPAzDataTableEntity @Table -Filter $Filter | Where-Object { $Tenants.defaultDomainName -contains $_.tenantFilter }) ?? @()
2626
} catch {
2727
Write-LogMessage -headers $Headers -API $APIName -message "Failed to retrieve check extension alerts: $($_.Exception.Message)" -Sev 'Error'
2828
$Alerts = @()

0 commit comments

Comments
 (0)