From e3db33c615adf47faf4558d9e585ee4cfcf64e8f Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Thu, 23 Aug 2018 21:02:41 +0200 Subject: [PATCH] Throw exception when nothing to clone in CloneDatabase Just in case something goes wrong, when calling. Change-Id: I4490aee6edccf0b185188250948a47b5fd8ba766 --- includes/db/CloneDatabase.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 1564fab225..5f09555e7a 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -52,6 +52,9 @@ class CloneDatabase { public function __construct( IMaintainableDatabase $db, array $tablesToClone, $newTablePrefix, $oldTablePrefix = null, $dropCurrentTables = true ) { + if ( !$tablesToClone ) { + throw new InvalidArgumentException( 'Empty list of tables to clone' ); + } $this->db = $db; $this->tablesToClone = $tablesToClone; $this->newTablePrefix = $newTablePrefix; -- 2.20.1