Skip to content

Commit

Permalink
prevent another null pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rgl committed Jul 10, 2024
1 parent 27a4abb commit ddef94e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Configure your packer template to require a [release version of the plugin](http
packer {
required_plugins {
windows-update = {
version = "0.16.1"
version = "0.16.3"
source = "github.com/rgl/windows-update"
}
}
Expand Down
3 changes: 2 additions & 1 deletion update/windows-update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ for ($i = 0; $i -lt $searchResult.Updates.Count; ++$i) {
continue
}

if ($update.InstallationBehavior.CanRequestUserInput) {
$updateCanRequestUserInput = try { $update.InstallationBehavior.CanRequestUserInput } catch { $false }
if ($updateCanRequestUserInput) {
Write-Output "Warning The update '$updateTitle' has the CanRequestUserInput flag set (if the install hangs, you might need to exclude it with the filter 'exclude:`$_.InstallationBehavior.CanRequestUserInput' or 'exclude:`$_.Title -like '*$updateTitle*'')"
}

Expand Down

0 comments on commit ddef94e

Please sign in to comment.