guard against a nil dereference

This commit is contained in:
clint shryock 2016-01-27 10:56:33 -06:00
parent 244e727c6f
commit dd0ca302de
1 changed files with 1 additions and 1 deletions

View File

@ -443,7 +443,7 @@ func testAccCheckAWSS3BucketWebsite(n string, indexDoc string, errorDoc string,
if *v.HostName != redirectTo {
return fmt.Errorf("bad redirect to, expected: %s, got %#v", redirectTo, out.RedirectAllRequestsTo)
}
if redirectProtocol != "" && *v.Protocol != redirectProtocol {
if redirectProtocol != "" && v.Protocol != nil && *v.Protocol != redirectProtocol {
return fmt.Errorf("bad redirect protocol to, expected: %s, got %#v", redirectProtocol, out.RedirectAllRequestsTo)
}
}