Skip to content

Commit

Permalink
fix: null configuration value (#222)
Browse files Browse the repository at this point in the history
# Pull Request

## Description

If a variable has a default of null and it is not supplied we see an
error in the logs.

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the projects associated license.
  • Loading branch information
jaredfholgate authored Oct 21, 2024
1 parent bda5b74 commit e636be3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ALZ/Private/Config-Helpers/Write-TfvarsJsonFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function Write-TfvarsJsonFile {
foreach($configurationProperty in $configuration.PSObject.Properties | Sort-Object Name) {
$configurationValue = $configurationProperty.Value.Value

if($configurationValue.ToString() -eq "sourced-from-env") {
if($null -ne $configurationValue -and $configurationValue.ToString() -eq "sourced-from-env") {
Write-Verbose "Sourced from env var: $($configurationProperty.Name)"
continue
}

Expand Down

0 comments on commit e636be3

Please sign in to comment.