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 2db83a6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ibm/service/power/resource_ibm_pi_capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,13 @@ func resourceIBMPICaptureCreate(ctx context.Context, d *schema.ResourceData, met
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)
if imagedata != nil {
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 2db83a6

Please sign in to comment.