From c0251dc09a41ce0b3d2f65be531d93217d5137e7 Mon Sep 17 00:00:00 2001 From: Deepak Selvakumar <77007253+deepaksibm@users.noreply.github.com> Date: Wed, 25 Sep 2024 09:13:41 +0530 Subject: [PATCH] fix(lb-pool-member): Add a nil check before accessing member weight --- ibm/service/vpc/resource_ibm_is_lb_pool_member.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ibm/service/vpc/resource_ibm_is_lb_pool_member.go b/ibm/service/vpc/resource_ibm_is_lb_pool_member.go index 02d1edf43b..cde8f6c29b 100644 --- a/ibm/service/vpc/resource_ibm_is_lb_pool_member.go +++ b/ibm/service/vpc/resource_ibm_is_lb_pool_member.go @@ -333,7 +333,9 @@ func lbpmemberGet(d *schema.ResourceData, meta interface{}, lbID, lbPoolID, lbPo if target.ID != nil { d.Set(isLBPoolMemberTargetID, *target.ID) } - d.Set(isLBPoolMemberWeight, *lbPoolMem.Weight) + if lbPoolMem.Weight != nil { + d.Set(isLBPoolMemberWeight, *lbPoolMem.Weight) + } d.Set(isLBPoolMemberProvisioningStatus, *lbPoolMem.ProvisioningStatus) d.Set(isLBPoolMemberHealth, *lbPoolMem.Health) d.Set(isLBPoolMemberHref, *lbPoolMem.Href)