providers/heroku: empty config vars block shouldn't panic [GH-1211]
This commit is contained in:
parent
19c7f8cff4
commit
e5a375ae58
|
@ -358,16 +358,20 @@ func updateConfigVars(
|
||||||
vars := make(map[string]*string)
|
vars := make(map[string]*string)
|
||||||
|
|
||||||
for _, v := range o {
|
for _, v := range o {
|
||||||
|
if v != nil {
|
||||||
for k, _ := range v.(map[string]interface{}) {
|
for k, _ := range v.(map[string]interface{}) {
|
||||||
vars[k] = nil
|
vars[k] = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for _, v := range n {
|
for _, v := range n {
|
||||||
|
if v != nil {
|
||||||
for k, v := range v.(map[string]interface{}) {
|
for k, v := range v.(map[string]interface{}) {
|
||||||
val := v.(string)
|
val := v.(string)
|
||||||
vars[k] = &val
|
vars[k] = &val
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("[INFO] Updating config vars: *%#v", vars)
|
log.Printf("[INFO] Updating config vars: *%#v", vars)
|
||||||
if _, err := client.ConfigVarUpdate(id, vars); err != nil {
|
if _, err := client.ConfigVarUpdate(id, vars); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue