From f140c15039ce2e8c6fee11a2bb2b0e011a837db3 Mon Sep 17 00:00:00 2001 From: Brett Mack Date: Tue, 17 Nov 2015 10:44:50 +0000 Subject: [PATCH] Fixed null pointer panic during firewall rules test --- builtin/providers/vcd/resource_vcd_firewall_rules_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/providers/vcd/resource_vcd_firewall_rules_test.go b/builtin/providers/vcd/resource_vcd_firewall_rules_test.go index ef766a20c..fe4171276 100644 --- a/builtin/providers/vcd/resource_vcd_firewall_rules_test.go +++ b/builtin/providers/vcd/resource_vcd_firewall_rules_test.go @@ -78,7 +78,10 @@ func createFirewallRulesConfigs(existingRules *govcd.EdgeGateway) string { Href: os.Getenv("VCD_URL"), VDC: os.Getenv("VCD_VDC"), } - conn, _ := config.Client() + conn, err := config.Client() + if err != nil { + return fmt.Sprintf(testAccCheckVcdFirewallRules_add, "", "") + } edgeGateway, _ := conn.OrgVdc.FindEdgeGateway(os.Getenv("VCD_EDGE_GATWEWAY")) *existingRules = edgeGateway log.Printf("[DEBUG] Edge gateway: %#v", edgeGateway)