diff --git a/src/Command/Auth/AuthLoginCommand.php b/src/Command/Auth/AuthLoginCommand.php index 9f48c5e44..faded08b5 100644 --- a/src/Command/Auth/AuthLoginCommand.php +++ b/src/Command/Auth/AuthLoginCommand.php @@ -27,7 +27,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $keys = $this->datastoreCloud->get('keys'); $activeKey = $this->datastoreCloud->get('acli_key'); // @todo this validation should really be enforced as a schema on the datastore. - if (count($keys) != 0 && !array_key_exists($activeKey, $keys)) { + if ( is_array($keys) && !empty($keys) != 0 && !array_key_exists($activeKey, $keys)) { throw new AcquiaCliException('Invalid key in Cloud datastore; run acli auth:logout && acli auth:login to fix'); } if ($activeKey) {