diff --git a/internal/services/vpcgw/network.go b/internal/services/vpcgw/network.go index 485ad80e37..3da2dc6cfe 100644 --- a/internal/services/vpcgw/network.go +++ b/internal/services/vpcgw/network.go @@ -240,7 +240,7 @@ func ResourceVPCGatewayNetworkRead(ctx context.Context, d *schema.ResourceData, return diag.FromErr(err) } - if gatewayNetwork.PrivateNetworkID != "" { + if gatewayNetwork != nil && gatewayNetwork.PrivateNetworkID != "" { diags = setPrivateIPsV1(ctx, d, apiV1, gatewayV1, m) }