aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/hashicorp/hcl/json/parser/flatten.go')
-rw-r--r--vendor/github.com/hashicorp/hcl/json/parser/flatten.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/hcl/json/parser/flatten.go b/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
index 6eb14a2..f652d6f 100644
--- a/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
+++ b/vendor/github.com/hashicorp/hcl/json/parser/flatten.go
@@ -48,6 +48,12 @@ func flattenListType(
item *ast.ObjectItem,
items []*ast.ObjectItem,
frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) {
+ // If the list is empty, keep the original list
+ if len(ot.List) == 0 {
+ items = append(items, item)
+ return items, frontier
+ }
+
// All the elements of this object must also be objects!
for _, subitem := range ot.List {
if _, ok := subitem.(*ast.ObjectType); !ok {