Skip to content

Commit

Permalink
mysql: Avoid crash on un-interpolated provider cfg (#12391)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored and stack72 committed Mar 5, 2017
1 parent 4ba145a commit 7d6e283
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/providers/mysql/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
var endpoint = d.Get("endpoint").(string)

proto := "tcp"
if endpoint[0] == '/' {
if len(endpoint) > 0 && endpoint[0] == '/' {
proto = "unix"
}

Expand Down

0 comments on commit 7d6e283

Please sign in to comment.