From 0230adf9831e91bbc4085ed6ed02f32595b294bc Mon Sep 17 00:00:00 2001 From: Alexander Kita Date: Wed, 30 Oct 2024 10:33:06 -0500 Subject: [PATCH] Fix null pointer, remove unused function --- .../power/resource_ibm_pi_virtual_serial_number.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/ibm/service/power/resource_ibm_pi_virtual_serial_number.go b/ibm/service/power/resource_ibm_pi_virtual_serial_number.go index f181588793..9ba962ee95 100644 --- a/ibm/service/power/resource_ibm_pi_virtual_serial_number.go +++ b/ibm/service/power/resource_ibm_pi_virtual_serial_number.go @@ -87,7 +87,9 @@ func resourceIBMPIVirtualSerialNumberCreate(ctx context.Context, d *schema.Resou if err != nil { return diag.FromErr(err) } - oldPvmInstanceId = *vsn.PvmInstanceID + if vsn.PvmInstanceID != nil { + oldPvmInstanceId = *vsn.PvmInstanceID + } if v, ok := d.GetOk(Arg_Description); ok { description := v.(string) if description != *vsn.Description { @@ -346,15 +348,6 @@ func resourceIBMPIVirtualSerialNumberUpdate(ctx context.Context, d *schema.Resou return resourceIBMPIVirtualSerialNumberRead(ctx, d, meta) } -func flattenVirtualSerialNumberToListSerialType(vsn *models.VirtualSerialNumber) []map[string]interface{} { - v := make([]map[string]interface{}, 1) - v[0] = map[string]interface{}{ - Attr_Description: vsn.Description, - Attr_Serial: vsn.Serial, - } - return v -} - func startLparAfterVSNChange(ctx context.Context, client *instance.IBMPIInstanceClient, id string, timeout time.Duration) error { body := &models.PVMInstanceAction{ Action: flex.PtrToString(Action_Start),