Skip to content

Commit

Permalink
Bug fix for flattening empty map slice for Amazon EBS
Browse files Browse the repository at this point in the history
  • Loading branch information
juliosueiras committed Sep 11, 2018
1 parent 147602b commit 279a39d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packer/data_source_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func dataSourceJSONRead(d *schema.ResourceData, meta interface{}) error {
}

for f := range t {
if FlattenNames[f] && t[f] != nil {
if FlattenNames[f] && t[f] != nil && len(t[f].([]interface{})) != 0 {
tempBlock := t[f].([]interface{})[0]
t[f] = tempBlock
} else if SpecialNames[f] && len(t[f].([]interface{})) != 0 && BlockNames[f] {
Expand Down

0 comments on commit 279a39d

Please sign in to comment.