From 6e9c0d293615fc5180e7ec13e24c6f47d18e66fe Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Thu, 2 Mar 2017 22:39:36 +0000 Subject: [PATCH] mysql: Avoid crash on un-interpolated provider cfg --- builtin/providers/mysql/provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/providers/mysql/provider.go b/builtin/providers/mysql/provider.go index a9027dc813ff..c333daed69aa 100644 --- a/builtin/providers/mysql/provider.go +++ b/builtin/providers/mysql/provider.go @@ -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" }