Skip to content

Commit e636be3

Browse files
fix: null configuration value (#222)
# 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.
1 parent bda5b74 commit e636be3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ALZ/Private/Config-Helpers/Write-TfvarsJsonFile.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ function Write-TfvarsJsonFile {
1919
foreach($configurationProperty in $configuration.PSObject.Properties | Sort-Object Name) {
2020
$configurationValue = $configurationProperty.Value.Value
2121

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

0 commit comments

Comments
 (0)