From e5a375ae586e23c79de797f067e5e474b986cfbe Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 26 Mar 2015 09:44:51 -0700 Subject: [PATCH] providers/heroku: empty config vars block shouldn't panic [GH-1211] --- builtin/providers/heroku/resource_heroku_app.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/builtin/providers/heroku/resource_heroku_app.go b/builtin/providers/heroku/resource_heroku_app.go index af27c7b26287..52954aa5d1fd 100644 --- a/builtin/providers/heroku/resource_heroku_app.go +++ b/builtin/providers/heroku/resource_heroku_app.go @@ -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 + } } }