Skip to content

Commit

Permalink
Fix null pointer bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Kita committed Oct 16, 2024
1 parent 62cb947 commit b008b56
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ibm/service/power/resource_ibm_pi_capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,13 @@ func resourceIBMPICaptureCreate(ctx context.Context, d *schema.ResourceData, met
imagedata, err := imageClient.Get(capturename)
if err != nil {
log.Printf("Error on get of ibm pi capture (%s) while applying pi_user_tags: %s", capturename, err)
}
if imagedata.Crn != "" {
oldList, newList := d.GetChange(Arg_UserTags)
err = flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, string(imagedata.Crn), "", UserTagType)
if err != nil {
log.Printf("Error on update of pi capture (%s) pi_user_tags during creation: %s", *imagedata.ImageID, err)
} else {
if imagedata.Crn != "" {
oldList, newList := d.GetChange(Arg_UserTags)
err = flex.UpdateGlobalTagsUsingCRN(oldList, newList, meta, string(imagedata.Crn), "", UserTagType)
if err != nil {
log.Printf("Error on update of pi capture (%s) pi_user_tags during creation: %s", *imagedata.ImageID, err)
}
}
}
}
Expand Down

0 comments on commit b008b56

Please sign in to comment.