From 4be35a5e4e638f73f86f0930c36a97882f3f02c0 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 19 Oct 2016 10:06:13 -0400 Subject: [PATCH] Don't assert nil values in convertStringArr Some of the inputs to this function may not have been validated --- builtin/providers/google/resource_compute_target_pool.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/builtin/providers/google/resource_compute_target_pool.go b/builtin/providers/google/resource_compute_target_pool.go index 148c765d7c..1680be90f4 100644 --- a/builtin/providers/google/resource_compute_target_pool.go +++ b/builtin/providers/google/resource_compute_target_pool.go @@ -89,9 +89,12 @@ func resourceComputeTargetPool() *schema.Resource { } func convertStringArr(ifaceArr []interface{}) []string { - arr := make([]string, len(ifaceArr)) - for i, v := range ifaceArr { - arr[i], _ = v.(string) + var arr []string + for _, v := range ifaceArr { + if v == nil { + continue + } + arr = append(arr, v.(string)) } return arr }