Skip to content

Commit a9db6ec

Browse files
committed
prevent another null pointer exception
1 parent c024b04 commit a9db6ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

update/windows-update.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ for ($i = 0; $i -lt $searchResult.Updates.Count; ++$i) {
200200
$properties = $update `
201201
| Get-Member $expectedProperties `
202202
| Select-Object -ExpandProperty Name
203-
if (Compare-Object $expectedProperties $properties) {
203+
if (!$properties -or (Compare-Object $expectedProperties $properties)) {
204204
throw "the windows update api returned a invalid update object. see https://github.com/rgl/packer-plugin-windows-update/issues/144."
205205
}
206206

0 commit comments

Comments
 (0)