From 321ca81f508464340af072fd44061b7280880b28 Mon Sep 17 00:00:00 2001 From: Evan Rademacher <44209290+erademacher@users.noreply.github.com> Date: Wed, 8 Feb 2023 12:49:55 -0800 Subject: [PATCH] Fix allowlist read when name is null (#78) --- internal/provider/networking_resource.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/provider/networking_resource.go b/internal/provider/networking_resource.go index 04610ba5..1c433068 100644 --- a/internal/provider/networking_resource.go +++ b/internal/provider/networking_resource.go @@ -200,7 +200,11 @@ func (r *allowListResource) Read(ctx context.Context, req resource.ReadRequest, // Update flags in case they've changed externally. state.Sql = types.BoolValue(entry.GetSql()) state.Ui = types.BoolValue(entry.GetUi()) - state.Name = types.StringValue(entry.GetName()) + if entry.Name == nil { + state.Name = types.StringNull() + } else { + state.Name = types.StringValue(entry.GetName()) + } diags = resp.State.Set(ctx, &state) resp.Diagnostics.Append(diags...) return