Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Conversation

@jason-fugue
Copy link
Contributor

This PR replaces our use of cty.NilVal with cty.NullVal. The included ternary-mismatch.json resulted in a panic from this line:

bucket = var.foo ? {"foo": "bar"} : aws_s3_bucket.foo.bucket

because the HCL library's error handling for mismatched conditional return types attempts to call a FriendlyName() method on each return type. cty.NilVal.Type() returns a native nil value, which results in a panic.

Copy link
Member

@jaspervdj-luminal jaspervdj-luminal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jason-fugue jason-fugue merged commit 04381be into master Dec 13, 2021
@jason-fugue jason-fugue deleted the fix/RM-6416/cty-nilval-panic branch December 13, 2021 19:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants