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)) }