Skip to content

Commit

Permalink
fix: check that channel policy exists
Browse files Browse the repository at this point in the history
OTT-6334
  • Loading branch information
thatsddr committed Aug 20, 2024
1 parent 4d0bb96 commit 2d88f04
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions awsmt/data_source_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ func (d *dataSourceChannel) Configure(_ context.Context, req datasource.Configur

func (d *dataSourceChannel) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
var data channelModel
diags := req.Config.Get(ctx, &data)
resp.Diagnostics.Append(diags...)
resp.Diagnostics.Append(req.Config.Get(ctx, &data)...)
if resp.Diagnostics.HasError() {
return
}
Expand All @@ -114,7 +113,7 @@ func (d *dataSourceChannel) Read(ctx context.Context, req datasource.ReadRequest
return
}

if policy.Policy != nil {
if policy != nil && policy.Policy != nil {
data.Policy = jsontypes.NewNormalizedPointerValue(policy.Policy)
}

Expand Down

0 comments on commit 2d88f04

Please sign in to comment.