diff --git a/system/Commands/Database/ShowTableInfo.php b/system/Commands/Database/ShowTableInfo.php index f955c6b27011..4c8f1bfd3865 100644 --- a/system/Commands/Database/ShowTableInfo.php +++ b/system/Commands/Database/ShowTableInfo.php @@ -125,7 +125,7 @@ public function run(array $params) $limitRows = (int) ($params['limit-rows'] ?? 10); $limitFieldValue = (int) ($params['limit-field-value'] ?? 15); - if (! in_array($tableName, $tables, true)) { + while (! in_array($tableName, $tables, true)) { $tableNameNo = CLI::promptByKey( ['Here is the list of your database tables:', 'Which table do you want to see?'], $tables, @@ -133,7 +133,7 @@ public function run(array $params) ); CLI::newLine(); - $tableName = $tables[$tableNameNo]; + $tableName = $tables[$tableNameNo] ?? null; } if (array_key_exists('metadata', $params)) {