Skip to content

Commit

Permalink
Merge pull request #18 from lingoda/08-create-storage-file-and-bug-fix
Browse files Browse the repository at this point in the history
Bugfix: Avoid exception on clear cache (database not exist)
  • Loading branch information
jorisdugue committed Sep 11, 2020
2 parents d79d011 + 3e8de10 commit 0cb9ab8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Core/H5POptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Studit\H5PBundle\Entity\Option;
use Doctrine\DBAL\Exception\ConnectionException;
use Doctrine\DBAL\Exception\TableNotFoundException;

class H5POptions
{
Expand Down Expand Up @@ -41,7 +43,10 @@ public function __construct(?array $config, $projectRootDir, EntityManagerInterf

public function getOption($name, $default = null)
{
$this->retrieveStoredConfig();
try {
$this->retrieveStoredConfig();
} catch (ConnectionException | TableNotFoundException $e) {
}

if (isset($this->storedConfig[$name])) {
return $this->storedConfig[$name];
Expand Down

0 comments on commit 0cb9ab8

Please sign in to comment.