if AWS region not found, return an error

This commit is contained in:
Stefan Reitshamer 2020-12-14 17:24:51 -05:00
parent f0d9fc2cd4
commit 5b288accbe

View file

@ -697,6 +697,10 @@
HSLogError(@"failed to get location of %@: %@", s3BucketName, myError);
} else {
AWSRegion *awsRegion = [AWSRegion regionWithLocation:location];
if (awsRegion == nil) {
SETNSERROR([self errorDomain], -1, @"unknown location: %@", location);
return nil;
}
HSLogDebug(@"awsRegion for s3BucketName %@: %@", s3BucketName, location);
NSURL *s3Endpoint = [awsRegion s3EndpointWithSSL:YES];