Skip to content

Commit f140c15

Browse files
author
Brett Mack
committed
Fixed null pointer panic during firewall rules test
1 parent cc54785 commit f140c15

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

builtin/providers/vcd/resource_vcd_firewall_rules_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ func createFirewallRulesConfigs(existingRules *govcd.EdgeGateway) string {
7878
Href: os.Getenv("VCD_URL"),
7979
VDC: os.Getenv("VCD_VDC"),
8080
}
81-
conn, _ := config.Client()
81+
conn, err := config.Client()
82+
if err != nil {
83+
return fmt.Sprintf(testAccCheckVcdFirewallRules_add, "", "")
84+
}
8285
edgeGateway, _ := conn.OrgVdc.FindEdgeGateway(os.Getenv("VCD_EDGE_GATWEWAY"))
8386
*existingRules = edgeGateway
8487
log.Printf("[DEBUG] Edge gateway: %#v", edgeGateway)

0 commit comments

Comments
 (0)