Skip to content

Commit

Permalink
Merge pull request #1315 from hashicorp/b-heroku-config-vars-2
Browse files Browse the repository at this point in the history
providers/heroku: empty config vars block shouldn't panic [GH-1211]
  • Loading branch information
mitchellh committed Mar 27, 2015
2 parents ce29a87 + e5a375a commit 7d846cb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions builtin/providers/heroku/resource_heroku_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,18 @@ func updateConfigVars(
vars := make(map[string]*string)

for _, v := range o {
for k, _ := range v.(map[string]interface{}) {
vars[k] = nil
if v != nil {
for k, _ := range v.(map[string]interface{}) {
vars[k] = nil
}
}
}
for _, v := range n {
for k, v := range v.(map[string]interface{}) {
val := v.(string)
vars[k] = &val
if v != nil {
for k, v := range v.(map[string]interface{}) {
val := v.(string)
vars[k] = &val
}
}
}

Expand Down

0 comments on commit 7d846cb

Please sign in to comment.