Skip to content

Commit

Permalink
Allow unlinking of billing account. Closes #133
Browse files Browse the repository at this point in the history
  • Loading branch information
ubschmidt2 committed Jun 17, 2017
1 parent f1ffb9d commit c7e4ad1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions google/resource_google_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ func resourceGoogleProjectUpdate(d *schema.ResourceData, meta interface{}) error
// Billing account has changed
if ok := d.HasChange("billing_account"); ok {
name := d.Get("billing_account").(string)
ba := cloudbilling.ProjectBillingInfo{
BillingAccountName: "billingAccounts/" + name,
ba := cloudbilling.ProjectBillingInfo{}
if name != "" {
ba.BillingAccountName = "billingAccounts/" + name
}
_, err = config.clientBilling.Projects.UpdateBillingInfo(prefixedProject(pid), &ba).Do()
if err != nil {
Expand Down

0 comments on commit c7e4ad1

Please sign in to comment.