From cbe9099835b0c723ff3ef6de3671ead1295de0e6 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Thu, 15 Aug 2024 16:12:46 +1000 Subject: [PATCH] Fix other list null issue --- octopusdeploy_framework/util/util.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/octopusdeploy_framework/util/util.go b/octopusdeploy_framework/util/util.go index c88634324..67c158f1c 100644 --- a/octopusdeploy_framework/util/util.go +++ b/octopusdeploy_framework/util/util.go @@ -60,10 +60,14 @@ func SetToStringArray(ctx context.Context, set types.Set) ([]string, diag.Diagno } func FlattenStringList(list []string) types.List { - if list == nil || len(list) == 0 { + if list == nil { return types.ListNull(types.StringType) } + if len(list) == 0 { + types.ListValueMust(types.StringType, []attr.Value{}) + } + elements := make([]attr.Value, 0, len(list)) for _, s := range list { elements = append(elements, types.StringValue(s))