Skip to content

Commit f3c5e3d

Browse files
committed
handle errors with cached data
1 parent dda5773 commit f3c5e3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/CIPPCore/Public/Webhooks/Test-CIPPAuditLogRules.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ function Test-CIPPAuditLogRules {
209209
} else {
210210
# Use cached lookups
211211
$Users = ($Lookups | Where-Object { $_.RowKey -eq 'users' }).Data | ConvertFrom-Json
212-
$Groups = (($Lookups | Where-Object { $_.RowKey -eq 'groups' }).Data | ConvertFrom-Json) ?? @()
213-
$Devices = (($Lookups | Where-Object { $_.RowKey -eq 'devices' }).Data | ConvertFrom-Json) ?? @()
212+
$Groups = (($Lookups | Where-Object { $_.RowKey -eq 'groups' }).Data | ConvertFrom-Json -ErrorAction SilentlyContinue) ?? @()
213+
$Devices = (($Lookups | Where-Object { $_.RowKey -eq 'devices' }).Data | ConvertFrom-Json -ErrorAction SilentlyContinue) ?? @()
214214
$ServicePrincipals = ($Lookups | Where-Object { $_.RowKey -eq 'servicePrincipals' }).Data | ConvertFrom-Json
215215
Write-Information "Using cached directory lookups for tenant $TenantFilter"
216216
}

0 commit comments

Comments
 (0)