From eb908d14f9c5c0e342edd7428787dba0c4d982a5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 8 Nov 2023 13:11:13 +0900 Subject: [PATCH] fix: Undefined array key error --- system/Commands/Database/ShowTableInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) {