Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Only create a new model registry if a connection could be established
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Oct 9, 2013
1 parent ee216e1 commit 78704e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/modules/core/library/Contao/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ protected function __construct(array $arrConfig)
{
$this->arrConfig = $arrConfig;
$this->connect();
$this->objModelRegistry = new \Model\Registry($this);

if (!is_resource($this->resConnection) && !is_object($this->resConnection))
{
throw new \Exception(sprintf('Could not connect to database (%s)', $this->error));
}

$this->objModelRegistry = new \Model\Registry($this);
}


Expand Down

0 comments on commit 78704e5

Please sign in to comment.