Skip to content

Commit 80e5831

Browse files
committed
len not nil
1 parent 741b3f2 commit 80e5831

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/fleet/agent_policy/models.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.
7979
model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId)
8080
model.Name = types.StringValue(data.Name)
8181
model.Namespace = types.StringValue(data.Namespace)
82-
if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && data.GlobalDataTags != nil {
82+
if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && len(*data.GlobalDataTags) > 0 {
8383
var diag diag.Diagnostics
8484
gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel)
8585
if diag.HasError() {

0 commit comments

Comments
 (0)