mysql: Avoid crash on un-interpolated provider cfg (#12391)

This commit is contained in:
Radek Simko 2017-03-05 13:58:15 +00:00 committed by Paul Stack
parent 4ba145a3ac
commit 7d6e2837e1
1 changed files with 1 additions and 1 deletions

View File

@ -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"
}