Skip to content

Commit 28d559e

Browse files
authored
Error earlier in non-interactive mode when an organization ID is required (#1566)
1 parent 9be9e3d commit 28d559e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Command/CommandBase.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,12 +2329,13 @@ protected function validateOrganizationInput(InputInterface $input, $filterByLin
23292329
}
23302330
}
23312331

2332-
$userId = $this->api()->getMyUserId();
2333-
$organizations = $this->api()->getClient()->listOrganizationsWithMember($userId);
2334-
23352332
if (!$input->isInteractive()) {
23362333
throw new ConsoleInvalidArgumentException('An organization name or ID (--org) is required.');
23372334
}
2335+
2336+
$userId = $this->api()->getMyUserId();
2337+
$organizations = $this->api()->getClient()->listOrganizationsWithMember($userId);
2338+
23382339
if (!$organizations) {
23392340
throw new NoOrganizationsException('No organizations found.', 0);
23402341
}

0 commit comments

Comments
 (0)