diff --git a/core/Db.php b/core/Db.php index b9067903975..d13f8998534 100644 --- a/core/Db.php +++ b/core/Db.php @@ -141,7 +141,9 @@ public static function hasDatabaseObject() */ public static function destroyDatabaseObject() { - DbHelper::disconnectDatabase(); + if (self::hasDatabaseObject()) { + DbHelper::disconnectDatabase(); + } self::$connection = null; }