From 7b933c8aa50006c80d973d3280a82a0f4d786cd1 Mon Sep 17 00:00:00 2001 From: Rahul Gupta Date: Sat, 18 Jan 2025 10:08:26 +0530 Subject: [PATCH] PHP error : undefined array key handled --- src/Command/CommandBase.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index 09ef0e790..e4c2655d8 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -1436,6 +1436,10 @@ protected function promptChooseAcsfSite(EnvironmentResponse $cloudEnvironment): foreach ($acsfSites['sites'] as $domain => $acsfSite) { $choices[] = "{$acsfSite['name']} ($domain)"; } + if (!count($choices)) { + throw new AcquiaCliException("Could not get ACSF sites"); + } + $choice = $this->io->choice('Choose a site', $choices, $choices[0]); $key = array_search($choice, $choices, true); $sites = array_values($acsfSites['sites']);