Skip to content

Commit

Permalink
Fix other list null issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HuyPhanNguyen committed Aug 15, 2024
1 parent 555a653 commit cbe9099
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion octopusdeploy_framework/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit cbe9099

Please sign in to comment.