]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Check for valid database connection object.
authorRoland Haeder <roland@mxchange.org>
Mon, 18 Aug 2014 07:39:27 +0000 (09:39 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 29 Mar 2020 22:20:05 +0000 (00:20 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
lib/installer.php

index 97886b40c51050f69b3aa63d9eb8ee0a3411d642..04d8bb8f35a02a6d156282ecc7bd4aaded6215c5 100644 (file)
@@ -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);