From fe6fad2c69897945c12c18ec4d81005ad6f3384d Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 18 Aug 2014 09:39:27 +0200 Subject: [PATCH] Check for valid database connection object. Signed-off-by: Roland Haeder --- lib/installer.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/installer.php b/lib/installer.php index 97886b40c5..04d8bb8f35 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -320,6 +320,11 @@ abstract class Installer } } + if (!$conn instanceof DB_common) { + // Is not the right instance + throw new Exception('Cannot connect to database: ' . $conn->getMessage()); + } + $res = $this->updateStatus("Creating database tables..."); if (!$this->createCoreTables($conn)) { $this->updateStatus("Error creating tables.", true); -- 2.39.5