Skip to content

Commit 9eda89a

Browse files
committed
fix sharing domain check
1 parent 98eb698 commit 9eda89a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardsharingDomainRestriction.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ function Invoke-CIPPStandardsharingDomainRestriction {
4040
if ($mode -eq 'none' -or $null -eq $mode) {
4141
$StateIsCorrect = $CurrentState.sharingDomainRestrictionMode -eq 'none'
4242
} else {
43-
$SelectedDomains = [String[]]$Settings.Domains.Split(',').Trim()
43+
$SelectedDomains = [String[]]$Settings.Domains.Split(',').Trim() ?? @()
4444
$StateIsCorrect = ($CurrentState.sharingDomainRestrictionMode -eq $mode) -and
45-
($mode -eq 'allowList' -and (!(Compare-Object -ReferenceObject $CurrentState.sharingAllowedDomainList -DifferenceObject $SelectedDomains))) -or
46-
($mode -eq 'blockList' -and (!(Compare-Object -ReferenceObject $CurrentState.sharingBlockedDomainList -DifferenceObject $SelectedDomains)))
45+
($mode -eq 'allowList' -and (!(Compare-Object -ReferenceObject $CurrentState.sharingAllowedDomainList -DifferenceObject $SelectedDomains))) -or
46+
($mode -eq 'blockList' -and (!(Compare-Object -ReferenceObject $CurrentState.sharingBlockedDomainList -DifferenceObject $SelectedDomains)))
4747
}
4848

4949
if ($Settings.remediate -eq $true) {

0 commit comments

Comments
 (0)