Skip to content

Commit

Permalink
Avoiding nil pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
charliecon committed Dec 23, 2024
1 parent 4d60f63 commit 10c3ca5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ func getAllIvrConfigs(ctx context.Context, clientConfig *platformclientv2.Config
}

for _, entity := range *allIvrs {
blockLabel := *entity.OpenHoursFlow.Name + "_" + *entity.Name
var blockLabel string
if entity.OpenHoursFlow != nil && entity.OpenHoursFlow.Name != nil {
blockLabel = *entity.OpenHoursFlow.Name + "_" + *entity.Name
} else {
blockLabel = *entity.Name
}
resources[*entity.Id] = &resourceExporter.ResourceMeta{BlockLabel: blockLabel}
}
return resources, nil
Expand Down

0 comments on commit 10c3ca5

Please sign in to comment.