Fix regionName parameter so as to not have a panic when it is not a string

This commit is contained in:
Andrey Kostov 2015-01-19 14:23:28 -08:00
parent 03406ab708
commit 671c69e0df

View file

@ -86,7 +86,7 @@ func FromParameters(parameters map[string]interface{}) (*Driver, error) {
secretKey, _ := parameters["secretkey"]
regionName, ok := parameters["region"]
if !ok || regionName.(string) == "" {
if !ok || fmt.Sprint(regionName) == "" {
return nil, fmt.Errorf("No region parameter provided")
}
region := aws.GetRegion(fmt.Sprint(regionName))