diff --git a/system/database.php b/system/database.php index 32877224..8fa8f869 100644 --- a/system/database.php +++ b/system/database.php @@ -122,7 +122,9 @@ try { $eloquentConnection = $capsule->getConnection(); - $twig->addGlobal('db', $db); + if (isset($twig)) { + $twig->addGlobal('db', $db); + } } catch (Exception $e) { if(isset($cache) && $cache->enabled()) {