From 0e37578bce941921397a9c47a04cc1a236c14363 Mon Sep 17 00:00:00 2001 From: Shuaib Bapputty Date: Fri, 8 Dec 2023 12:54:39 +0530 Subject: [PATCH] fix nil check --- ibm/service/mqcloud/utils.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ibm/service/mqcloud/utils.go b/ibm/service/mqcloud/utils.go index 10fe54094b..60f5ae5005 100644 --- a/ibm/service/mqcloud/utils.go +++ b/ibm/service/mqcloud/utils.go @@ -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" ) @@ -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" {