Skip to content

Commit

Permalink
fix nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuaib Bapputty committed Dec 12, 2023
1 parent 5d8d1a0 commit 0e37578
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ibm/service/mqcloud/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (

"github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns"
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex"
"github.com/IBM/mqcloud-go-sdk/mqcloudv1"
rc "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

"github.com/IBM/mqcloud-go-sdk/mqcloudv1"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down Expand Up @@ -51,13 +52,14 @@ func waitForQmStatusUpdate(context context.Context, d *schema.ResourceData, meta
getQueueManagerStatusOptions.SetServiceInstanceGuid(parts[0])
getQueueManagerStatusOptions.SetQueueManagerID(parts[1])
queueManagerStatus, response, err := mqcloudClient.GetQueueManagerStatusWithContext(context, getQueueManagerStatusOptions)
fmt.Println("The queue manager is currently in the " + *queueManagerStatus.Status + " state ....")
if err != nil {
return "", "", fmt.Errorf("GetQueueManagerWithContext ...... %s err: %s", response, err)
}
if queueManagerStatus == nil || queueManagerStatus.Status == nil {
return nil, "", fmt.Errorf("queueManagerStatus or queueManagerStatus.Status is nil")
}
fmt.Println("The queue manager is currently in the " + *queueManagerStatus.Status + " state ....")

if *queueManagerStatus.Status == "running" {
return queueManagerStatus, qmStatus, nil
} else if *queueManagerStatus.Status == "initialization_failed" || *queueManagerStatus.Status == "restore_failed" || *queueManagerStatus.Status == "status_not_available" {
Expand Down

0 comments on commit 0e37578

Please sign in to comment.