From 8352c3f5eb2534a2cf253346dc9cb26aed049416 Mon Sep 17 00:00:00 2001 From: hkavya26 Date: Fri, 29 Oct 2021 10:52:20 +0530 Subject: [PATCH] Fix: Crash on cloud_shell settings datasource --- ibm/data_source_ibm_cloud_shell_account_settings.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibm/data_source_ibm_cloud_shell_account_settings.go b/ibm/data_source_ibm_cloud_shell_account_settings.go index e0f2d41fcd..e0d029e59f 100644 --- a/ibm/data_source_ibm_cloud_shell_account_settings.go +++ b/ibm/data_source_ibm_cloud_shell_account_settings.go @@ -122,7 +122,7 @@ func dataSourceIBMCloudShellAccountSettingsRead(context context.Context, d *sche getAccountSettingsOptions.SetAccountID(d.Get("account_id").(string)) accountSettings, response, err := ibmCloudShellClient.GetAccountSettingsWithContext(context, getAccountSettingsOptions) - if err != nil { + if err != nil || accountSettings == nil { log.Printf("[DEBUG] GetAccountSettingsWithContext failed %s\n%s", err, response) return diag.FromErr(fmt.Errorf("GetAccountSettingsWithContext failed %s\n%s", err, response)) }