Fix php warning on not correcly loaded configs "Trying to access array offset on value of type null"
Reported for users not having correct permissions Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
652d264f9b
commit
a497000b98
@ -28,6 +28,7 @@ use const DIRECTORY_SEPARATOR;
|
|||||||
use const E_USER_WARNING;
|
use const E_USER_WARNING;
|
||||||
use function sprintf;
|
use function sprintf;
|
||||||
use function trigger_error;
|
use function trigger_error;
|
||||||
|
use function is_array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle front end templating
|
* Handle front end templating
|
||||||
@ -63,7 +64,9 @@ class Template
|
|||||||
'auto_reload' => true,
|
'auto_reload' => true,
|
||||||
'cache' => $cache_dir,
|
'cache' => $cache_dir,
|
||||||
]);
|
]);
|
||||||
if ($cfg['environment'] === 'development') {
|
|
||||||
|
// It was reported that the config could not be loaded correctly
|
||||||
|
if (is_array($cfg) && $cfg['environment'] === 'development') {
|
||||||
$twig->enableDebug();
|
$twig->enableDebug();
|
||||||
$twig->addExtension(new DebugExtension());
|
$twig->addExtension(new DebugExtension());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user