Skip to content

Commit

Permalink
added a nil check for boottarget of bms
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwal-ibm authored and hkantare committed Jan 2, 2024
1 parent 7bdec7e commit b579400
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ibm/service/vpc/resource_ibm_is_bare_metal_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1361,9 +1361,11 @@ func bareMetalServerGet(context context.Context, d *schema.ResourceData, meta in
}
d.SetId(*bms.ID)
d.Set(isBareMetalServerBandwidth, bms.Bandwidth)
bmsBootTargetIntf := bms.BootTarget.(*vpcv1.BareMetalServerBootTarget)
bmsBootTarget := bmsBootTargetIntf.ID
d.Set(isBareMetalServerBootTarget, bmsBootTarget)
if bms.BootTarget != nil {
bmsBootTargetIntf := bms.BootTarget.(*vpcv1.BareMetalServerBootTarget)
bmsBootTarget := bmsBootTargetIntf.ID
d.Set(isBareMetalServerBootTarget, bmsBootTarget)
}
cpuList := make([]map[string]interface{}, 0)
if bms.Cpu != nil {
currentCPU := map[string]interface{}{}
Expand Down

0 comments on commit b579400

Please sign in to comment.