Skip to content

Commit 815cb33

Browse files
authored
Merge pull request KelvinTegelaar#1608 from Zacgoose/quota-alert
Add null checks to mailbox quota alert
2 parents d7e8d8c + 898ab21 commit 815cb33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertQuotaUsed.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function Get-CIPPAlertQuotaUsed {
1717
return
1818
}
1919
$OverQuota = $AlertData | ForEach-Object {
20-
if ($_.StorageUsedInBytes -eq 0 -or $_.prohibitSendReceiveQuotaInBytes -eq 0) { return }
20+
if ([string]::IsNullOrEmpty($_.StorageUsedInBytes) -or [string]::IsNullOrEmpty($_.prohibitSendReceiveQuotaInBytes) -or $_.StorageUsedInBytes -eq 0 -or $_.prohibitSendReceiveQuotaInBytes -eq 0) { return }
2121
try {
2222
$PercentLeft = [math]::round(($_.storageUsedInBytes / $_.prohibitSendReceiveQuotaInBytes) * 100)
2323
} catch { $PercentLeft = 100 }

0 commit comments

Comments
 (0)