Commit d08c103f authored by davisben's avatar davisben
Browse files

Issue #3317272: Ensure a profile exists before attempting to create a client

parent 70789a1c
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -36,15 +36,18 @@ class AwsClientFactory implements AwsClientFactoryInterface {
    $service = $this->aws->getService($service_id);

    if ($this->profile) {
      $client_args = $this->profile->getClientArgs();
      $profile = $this->profile;
    }
    else {
      $profile = $this->aws->getProfile($service_id);
      $client_args = $profile->getClientArgs();
    }

    if (!$profile) {
      return FALSE;
    }

    $class = "\Aws\\{$service['namespace']}\\{$service['namespace']}Client";
    return new $class($client_args);
    return new $class($profile->getClientArgs());
  }

}