Merge pull request #27710 from hashicorp/paddy_empty_diags

Fix empty diags not getting associated with source.
This commit is contained in:
James Bardin 2021-02-12 16:14:14 -05:00 committed by GitHub
commit 6e72b04cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ func ProtoToDiagnostics(ds []*proto.Diagnostic) tfdiags.Diagnostics {
var newDiag tfdiags.Diagnostic var newDiag tfdiags.Diagnostic
// if there's an attribute path, we need to create a AttributeValue diagnostic // if there's an attribute path, we need to create a AttributeValue diagnostic
if d.Attribute != nil { if d.Attribute != nil && len(d.Attribute.Steps) > 0 {
path := AttributePathToPath(d.Attribute) path := AttributePathToPath(d.Attribute)
newDiag = tfdiags.AttributeValue(severity, d.Summary, d.Detail, path) newDiag = tfdiags.AttributeValue(severity, d.Summary, d.Detail, path)
} else { } else {