diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index a2a744b0e..d9083f5db 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -2329,12 +2329,13 @@ protected function validateOrganizationInput(InputInterface $input, $filterByLin } } - $userId = $this->api()->getMyUserId(); - $organizations = $this->api()->getClient()->listOrganizationsWithMember($userId); - if (!$input->isInteractive()) { throw new ConsoleInvalidArgumentException('An organization name or ID (--org) is required.'); } + + $userId = $this->api()->getMyUserId(); + $organizations = $this->api()->getClient()->listOrganizationsWithMember($userId); + if (!$organizations) { throw new NoOrganizationsException('No organizations found.', 0); }