Skip to content

Commit 030a150

Browse files
committed
Add proper null checks to handle "0" values not being evaluated as false.
Additionally handle simpleSettingsValue that have no choiceSettingValue, so that value extraction happens for these cases too.
1 parent ff261e7 commit 030a150

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Modules/CIPPCore/Public/Compare-CIPPIntuneObject.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ function Compare-CIPPIntuneObject {
244244
$child.choiceSettingValue.value
245245
}
246246
}
247+
if (!$childValue -and $null -ne $child.simpleSettingValue -and $null -ne $child.simpleSettingValue.value) {
248+
$childValue = $child.simpleSettingValue.value
249+
}
247250

248251
# Add object to our temporary list
249252
[PSCustomObject]@{
@@ -337,9 +340,9 @@ function Compare-CIPPIntuneObject {
337340
} else {
338341
$child.choiceSettingValue.value
339342
}
340-
if (!$childValue -and $child.simpleSettingValue.value) {
341-
$childValue = $child.simpleSettingValue.value
342-
}
343+
}
344+
if (!$childValue -and $null -ne $child.simpleSettingValue -and $null -ne $child.simpleSettingValue.value) {
345+
$childValue = $child.simpleSettingValue.value
343346
}
344347

345348
# Add object to our temporary list

0 commit comments

Comments
 (0)